LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Harald Staff
 
Posts: n/a
Default

A macro is a piece of programming code. The one I sent you will open your
big text file and generate many new smaller ones, each containining 20000
rows from your original file.

To run this, do the following:
Open excel. Open a new blank workbook.
Open the Visual basic Editor (by Alt F11 or by menu Tools Macro VB
Editor).
Inside the VB editor, go menu Insert Module.
You will see a white document now. This is a module. Copy-paste my
programming code into it, starting with the word Sub and ending with the
line End Sub.

Inside this code are two things you must consider:

1 The folder-file specifications to be written. In my code it says twice
"C:\Temp\Part"
You need a folder C:\Temp on your computer and you must be allowed to write
to it. If not then change this in the code so that it writes to anoether
location than C:\Temp

2 The number 20000 .This is the number of lines in the new textfiles. Change
if 20000 is too many or to few.

Now return to Excel. In its menu Tools Macro Run you can start the
macro. When you run it it asks you to open the textfile. Choose your big AOP
textfile in this dialog, or Cancel to abort the macro. The macro will run
for a while, and you will not see anything happening except an indicator
down left in the excel window.

After the macro you can hopefully open the file "C:\Temp\Part00000001.txt"
and its relatives in Excel.

This was hopefully suffif\cient macro details. Did you try to import the
textfile to Access ? That may be a far better way to solve this.

Best wishes Harald

"Khawajaanwar" skrev i melding
...
Please explain how I wrote Macros in C:\Temp folder since I am a bigginner
and i don't know how to write Macros in C:\Temp folder. My text file name
is
"AOP". Please explain in details

"Harald Staff" wrote:

This is impossible to answer detailed enough without knowing the
structure
of the huge textfile. But try to open Access and create a new empty
database
with the opening wizard. Then go menu
File Get external data Import
choose textfile as filetype, point to your enormous file and try to
import
it.

This is really not a beginner task. You are given Office and an enormous
textfile without further instructions, and maybe or maybe not someone
will
pay his tax if you can solve it ? We should do this, my friend, if only
for
the fun of it. Did my previous macro solution make any sense, or is it
unknown territory ?

Best wishes Harald

"Khawajaanwar" skrev i melding
...
I actually working in the tax department in Pakistan, i have to
extracts

the
data where in a column A or B number 26, 12 and 13 are written. Please
explain in details since i am bigginner and using Microsoff Office XP
2000

or
is there any way i can open this complete file in MS Access

Thanks again






 
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
opening text files that have more rows than 65536 rondajoy Excel Worksheet Functions 3 June 8th 05 03:41 PM
Opening a file with a Macro Adam1 Chicago Excel Discussion (Misc queries) 2 February 28th 05 10:13 PM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 12:37 AM
Make a text file from Excel workbook Ramana Murthy Excel Discussion (Misc queries) 7 January 3rd 05 05:37 PM
Problem opening an XML file in Excel - getting "ns1:macrosPresent" rprondeau Excel Discussion (Misc queries) 0 December 15th 04 03:39 PM


All times are GMT +1. The time now is 04:31 PM.

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"