LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default open text file to extract data

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


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSV text data altered on file open Mike P[_2_] Excel Discussion (Misc queries) 4 May 29th 08 05:25 PM
Open text file in excel that has multiple rows of data Jeanne Excel Discussion (Misc queries) 1 January 10th 07 01:46 PM
Search/Extract Data w/in Text File D.Parker Excel Discussion (Misc queries) 4 June 21st 05 07:33 PM
Open delimited text file to excel without changing data in that file zohanc Excel Programming 1 October 3rd 03 01:06 AM
How to open a zip file and extract its contents in a macro? Audie G. Bencosme R. Excel Programming 1 October 2nd 03 03:52 AM


All times are GMT +1. The time now is 08:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"