Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
working with .txt files in a macro
I'm trying to open a file folder so I can then open a .txt file. The .txt
files will all have unique numbers against them and I cannot figure out how to tell my macro to open the folder but let me choose the .txt file I need to open. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
working with .txt files in a macro
Maybe this willh help............
Sub Getfile() '=========================================== 'Offers pop-up to allow user to select file to be opened, then opens it '=========================================== Dim FileToCheck FileToCheck = Application.GetOpenFilename("Excel file to test (*.xls),*.xls") If FileToCheck < False Then On Error Resume Next Workbooks.Open FileName:=FileToCheck End If End Sub "Peggy" wrote: I'm trying to open a file folder so I can then open a .txt file. The .txt files will all have unique numbers against them and I cannot figure out how to tell my macro to open the folder but let me choose the .txt file I need to open. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
working with .txt files in a macro
Thank you for this code. It works really well, and I've tweaked it to open
..txt files. How do I format the spreadsheet as it is reading everything in one cell. meaning I have a complete sentence in one cell, whereas I need the information all in separate cells. Any easy tips, rather than writing lengthy 'if' formulas?!! Thanks for your help. Kind regards, Peggy "CLR" wrote: Maybe this willh help............ Sub Getfile() '=========================================== 'Offers pop-up to allow user to select file to be opened, then opens it '=========================================== Dim FileToCheck FileToCheck = Application.GetOpenFilename("Excel file to test (*.xls),*.xls") If FileToCheck < False Then On Error Resume Next Workbooks.Open FileName:=FileToCheck End If End Sub "Peggy" wrote: I'm trying to open a file folder so I can then open a .txt file. The .txt files will all have unique numbers against them and I cannot figure out how to tell my macro to open the folder but let me choose the .txt file I need to open. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
working with .txt files in a macro
Try this.......
Data TextToColumns Delimited select "space" for the delimiter....... Vaya con Dios, Chuck, CABGx3 "Peggy" wrote: Thank you for this code. It works really well, and I've tweaked it to open .txt files. How do I format the spreadsheet as it is reading everything in one cell. meaning I have a complete sentence in one cell, whereas I need the information all in separate cells. Any easy tips, rather than writing lengthy 'if' formulas?!! Thanks for your help. Kind regards, Peggy "CLR" wrote: Maybe this willh help............ Sub Getfile() '=========================================== 'Offers pop-up to allow user to select file to be opened, then opens it '=========================================== Dim FileToCheck FileToCheck = Application.GetOpenFilename("Excel file to test (*.xls),*.xls") If FileToCheck < False Then On Error Resume Next Workbooks.Open FileName:=FileToCheck End If End Sub "Peggy" wrote: I'm trying to open a file folder so I can then open a .txt file. The .txt files will all have unique numbers against them and I cannot figure out how to tell my macro to open the folder but let me choose the .txt file I need to open. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hyperlink not working in 2003 for JPG & PNG files | Excel Discussion (Misc queries) | |||
Cell References Between sheets or Files Not Working | Excel Discussion (Misc queries) | |||
less noise when working with CSV files | Excel Discussion (Misc queries) | |||
working excel files keeping on desktop | Excel Worksheet Functions | |||
Installed Analyst Toolpak but not working for files used at work? | Excel Worksheet Functions |