Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Moving the cursor around with a macro....

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!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Moving the cursor around with a macro....



"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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Moving the cursor around with a macro....

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Moving the cursor around with a macro....

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Moving the cursor around with a macro....

I am trying to "weed" out duplicates from the cell above. The process is
compare the active cell with the cell above and if they match, format it a
certain way and then advance the active dell down one cell. Easier said than
done, for me.

"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

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Moving the cursor around with a macro....

you could do this
(1) using Conditional Formatting. For exampl if you want to see duplicates
in D, then select the entire column, select Format/Conditional Formatting,
switch to Formula Is and add the formula
=AND(D1=D2,D1<"")
then select some back color or whatever

(2) use COUNTIF so in E1 put =COUNTIF(D:D,D1) copy the formula down.
use autofilter on E where the value <1 or 1

(3) in VBA:

col="D"
for rw = 2 to cells(1,col).End(xldown).Row
if cells(rw,col)=cells(rw-1,col) then
cells(rw,col).Iterior.Color=vbRed
end if
next

"HpyTrvlr69" wrote in message
...
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!!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
moving cursor in a macro Amanda Excel Discussion (Misc queries) 3 June 18th 09 03:09 AM
moving the cursor in a macro Amanda Excel Discussion (Misc queries) 1 June 18th 09 02:05 AM
moving cursor PECOSBOB Excel Worksheet Functions 1 January 17th 09 01:27 PM
moving cursor aby New Users to Excel 2 November 2nd 08 10:45 PM
Moving the cursor Gandhi Bojja Excel Programming 3 May 22nd 07 08:15 AM


All times are GMT +1. The time now is 08:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"