Thread: Macro problems
View Single Post
  #4  
Old April 20th, 2010, 11:24 PM posted to microsoft.public.excel.misc
Dave Peterson
external usenet poster
 
Posts: 19,791
Default Macro problems

Sometimes, it's better to describe what you want to do.

For instance, if I want to select the cell after the last used cell in column A,
I'd use something like:

Dim NextCell as range
dim Wks as worksheet

with wks
set nextcell = .cells(.rows.count,"A").end(xlup).offset(1,0)
end with

nextcell.select

I like to start at the bottom of the worksheet and look upwards. Some look
downward from the cell. But if there are empty cells in the range, that may not
do what I want.



Father John wrote:

Hi I am trying to record a simple macro where if I press alt+d the location
moves 7 "page down" key strokes - about 100 rows.
However when I record the macro it resorts back to the line number that my
macro originally ended up at 7 keystrokes from the top., even if I am 1500
lines down.
How can I resolve this?

With thanks
Stephen

(My apologies if this is duplicated as I cannot see the original post after
12 hours)


--

Dave Peterson