Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Macro - Steering to a directory/file

Status
Not open for further replies.

ZOR

Technical User
Jan 30, 2002
2,963
GB
I have a macro which opens a text file and imports into spreadsheet. Can someone tell me how to add code to make the macro go to the drive C:Temp, and look for .txt files.

Thanks very much
 
Sorry, ommited this bit. The code to open the file selection dialogue box.

I have tried putting ChDir everywhere but nothing seems to change it from going to the applications directory. Thanks

FileName = Application.GetOpenFilename(FileFilter:=Filt, FilterIndex:=FilterIndex, Title:=Title)
 
It's sorted, thanks. It must have been the macro was not resetting itself during editing step through, as it works when fired up. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top