Results 1 to 4 of 4

Thread: Extract Data From Text File Using VBA

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    You are welcome and thanks for the feedback,
    Alan

    ( P.s. Possibly you are aware of this, but just in case you don't know this, I thought I would mention it in passing...
    You have a couple of lines like this
    Dim FileToOpen, A(11) As Variant
    Dim c, R As Long


    What you have there is actually this, ( since variant is the default when you do not explicitly do it )
    Dim FileToOpen As Variant, A(11) As Variant
    Dim c As Variant, R As Long


    It does make sense to have FileToOpen as Variant, because you may get a String type returned to it or a Boolean False. So a Variant is required to hold either of those two types.
    But I am not sure what c is supposed to be in your coding. I may have missed something. If you wanted c to be dimensioned a Long type, then you would need to do this:
    Dim c As Long, R As Long

    If you do , as you did, this .._
    Dim c, R As Long
    _.. then c will then be dimensioned as a Variant)
    Last edited by DocAElstein; 05-26-2019 at 07:21 PM.

Similar Threads

  1. VBA Macro to open a file and extract data
    By jeremiah_j2k in forum Excel Help
    Replies: 0
    Last Post: 05-22-2017, 03:17 PM
  2. Replies: 2
    Last Post: 12-11-2014, 09:30 AM
  3. VBA To Extract Certain Rows From A Text File
    By Bogdan in forum Excel Help
    Replies: 4
    Last Post: 08-31-2013, 06:57 PM
  4. How to extract all text from a word file?
    By vsrawat in forum Word Help
    Replies: 3
    Last Post: 09-25-2012, 10:24 PM
  5. How to extract all text from a ppt file
    By vsrawat in forum Powerpoint Help
    Replies: 2
    Last Post: 09-25-2012, 10:23 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •