Count rows, post result in new book
If you post the code we probably can add improvements
To get the last row use
LastRow = Range("A" & rows.count).end(xlup).row
Rows.Count for excel 2003 is 65536. It is a constant in excel. This code
says to go to the last row (65536) in column A and move up the worksheet
until data is found in a cell and then return the row number.
You are going to havve to creat a new workbook and then use a SAVEAS to save
the data. Not sure why you would want to put the number into a Workbook,
would be better as a text file.
"Jumparound" wrote:
Hello,
first of all, im not a programmer.
I do this to automate an very very boring task @ work.
This is what i do.
I import a text file into excel.
I add our layout to the sheet.
I write down the number of rows.
Then I save it with a new name.
this x 35.
Now, this is what i did in VBA (detail are not that important)
Call OpenTextFile001
Call Format
Call Save001
Call Nextfile
Call OpenTextFile002
Call Format
Call Save002
Call Nextfile
I made a macro of every step. This way somebody else can open the
macro and edit it with new information when im not at the office.
The only thing i havnt managed to solve is the Number of rows part.
I want to copy the numer of rows to a new workbook for each file I
process.
There is a very specific order in wich the files are processed, so all
I need in a new sheet would be a number.
Could someone help me with a SUB?
|