S
S.E.
I am only familiar with the very basics of writing macros, but I am trying
my hand at writing my first one with hopes of learning more.
I want to write a macro that will save me a lot of repetitive work. The
first step is to open a text file in order to extract some data that I can
manipulate in Excel. When I do it without a macro, the text import wizard
opens and I am able to import the data as from a fixed width file. What I
have tried in the macro is not working:
Public Sub prepareImport()
fileToOpen = Application.GetOpenFilename("Text Files (*.txt), *.txt")
Open "fileToOpen" For Random As #2
End Sub
Does anyone have ideas to help me get started?
Thanks in advance,
Scott
my hand at writing my first one with hopes of learning more.
I want to write a macro that will save me a lot of repetitive work. The
first step is to open a text file in order to extract some data that I can
manipulate in Excel. When I do it without a macro, the text import wizard
opens and I am able to import the data as from a fixed width file. What I
have tried in the macro is not working:
Public Sub prepareImport()
fileToOpen = Application.GetOpenFilename("Text Files (*.txt), *.txt")
Open "fileToOpen" For Random As #2
End Sub
Does anyone have ideas to help me get started?
Thanks in advance,
Scott