Macro help (last row)

T

tbrooks

Hello: I have recorded a macro to do a certain function everyday. The
column formatting for the macro is the same everyday but the number of rows
that it contains may differ from day to day. I do not know how to do visual
basic and have recorded the macro by doing the functions needed. The problem
is that it records where to start deleting the rows just from that one days
file and I need it to be shorter or longer depending on the number of rows
there are in the file for that day. Can you please help?
 
B

Bob Phillips

You can get the last row in column A with

iLastRow = Cells(Rows.Count,"A").End(xlUp).Row
 
D

David McRitchie

Deleting rows is very simple, but without the specifics on how to determine
what you want deleted and what "that day" is, you are leaving a lot to the
imagination. Perhaps you could describe what you want deleted, which
would be a lot more descriptive than "I recorded a macro".

Generally recording a macro just gets you some hints as to the kind of instructions
you might use, it normally does not generate the exact code you need or want.

Also if you place something in the subject line it had better be described
in the body of the question; otherwise, it will probably be ignored, and it
would not be summary of the problem. "last row" is not described.

CIA speak: or request for a mind reader:
certain function, column formatting, depending on the number of rows.

There is a whole newsgroup dedicated to macros
microsoft.public.excel.programming
the subject description if posted in that newsgroup would be utterly meaningless
in describing what you want. Nevertheless, please continue with your current
posting rather than starting a new one.

Some items that may be of interest:

Delete Cells/Rows in Range, based on empty cells, or cells with specific values
http://www.mvps.org/dmcritchie/excel/delempty.htm

Date and Time
http://www.mvps.org/dmcritchie/excel/datetime.htm
 
Top