Thread: Macro editing
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Macro editing

to get the last row or column you need to use the END method. there is two
form of the method, one for rows and one for columns

LastRow = cells(Rows.count,"A").end(xlup).row

Row.count = 64536 the last row on the worksheet. XLUP tells excel to move
up the worksheet until it finds a non empty cell. You can use any colymn in
place of "A"

LastColumn = cells(1,Columns.count).end(xltoleft).column

Columns.count = 256 the lat column in the worksheet. XLTOLEFT tells excel
to go left until it finds a non-empty cell

256 and 64536 are the limits in excel 2003. Ecel 2007 has an extended range.

"Skeeter" wrote:

Thanks Bob for your quick response! I did run the Macro manually and it does
essentially what I want it to do except that when I run the Macro the second
time it just repeats and enters the same name and values again in the same
worksheet at the same location. I want the Macro to continue down my list
and insert each new name and values one after the other. My problem is I
don't know how tot tell the Macro in the editing window of VBE how to perform
this task.

"Tim" wrote:

Hi,

And Run it as much as you want

Regards,

Tim


"Bob Phillips" wrote:

Do it manually with the macro recorder turned on, this will generate the
basic code. Then just edit it for flexibility.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Skeeter" wrote in message
...
I am trying to create a Macro where I select a name from a filtered list I
created. I need the Macro to select the next row or name in the filtered
list each time I activate my Macro. This filtered list has data attached
to
the names and the filter selects all the numbers I need to be pasted into
a
worksheet titled "Totals".