Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: pass userform.getopenfilename to spreadsheet variable

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I'm using a form to get input txt file, I then need to pass the filename to my spreadsheet so I may inport the file.
    Any ideas ?? Thanks,

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Posts
    76
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-22 16:09, Mr_Semper wrote:
    I'm using a form to get input txt file, I then need to pass the filename to my spreadsheet so I may inport the file.
    Any ideas ?? Thanks,
    Pass it to where in the spreadsheet? Do you want to copy the name into a cell? Or what?

    If you want to import the text file with VBA, that can also be done. Please be a little more specific and I or someone else will be more likely to help.

  3. #3
    MrExcel MVP Jay Petrulis's Avatar
    Join Date
    Mar 2002
    Location
    Chicago, IL USA
    Posts
    2,040
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-22 16:09, Mr_Semper wrote:
    I'm using a form to get input txt file, I then need to pass the filename to my spreadsheet so I may inport the file.
    Any ideas ?? Thanks,
    MyFile= Application.GetOpenFilename(Title:="Import file")

    Will prompt you for the file to open and store it in the variable MyFile. You can then write the MyFile string to the worksheet (???) or use Workbooks.OpenText to open the file as you'd like.

    HTH,
    Jay

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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