View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
HpyTrvlr69 HpyTrvlr69 is offline
external usenet poster
 
Posts: 15
Default Moving the cursor around with a macro....

Well I am trying to tell if the cell above it is a duplicate, if it is, I
format both cells and then advance one cell down and do the process all over
again. Thanks for the info so far.

"FSt1" wrote:

ooo
i re-read your second post.
matches what??
regards
FSt1

"FSt1" wrote:

hi
there are a number of ways to do this. basicily
range("a2").select

or with a range name..
lets say your range name is myrange
range("myrange").select

or maybe with varialbes..
dim r as range
set r = range("A2")
r.select

or if moving down a list in a loop....
dim r as range
dim ro as range
set r = range("A2")
do until stuff = done
set ro = r.offset(1,0)
r.select
stuff
set r = ro
loop

you may want to know the difference between select and activate.
run this macro
range("A2:F10").select
range("C5").activate

normally when selecting a range, the upper left cell becomes the active
cell. but in the above example C5 is the activecell, not A2.

in short, the method used depends on situation. but normally selecting the
cells is not neccessary unless you just want to entertain your users with the
curser and screen flopping all over the place. that slows things down.
but it does entrertain the users.

post back if i didn't cover something.
regards
FSt1

"HpyTrvlr69" wrote:



"HpyTrvlr69" wrote:

Silly question for all you smart guys out here....where does one lookup info
on the moving and selecting of cursor and cell locations programmatically
(Macro or VB). I know....Im really dumb!!
My basic use is to test cells in a column for matches and move down the
column, cell by cell, as the test continues