PDA

View Full Version : [SOLVED] Making the next cell active



Tenspeed39355
02-18-2005, 01:21 PM
Can someone help me with this macro? I have a ss with stock symbols in
Sheet1 A1:A450. Can a macro be written that will make each cell in A1:A450
active one at a time moving thru the whole list of symbols just like I would take
the mouse and click on them one at a time.
Thanks for your time
Max:hi:

Norie
02-18-2005, 01:50 PM
You could try code like this.


Dim rng As Range
Dim c As Range
Set rng = Worksheets("Sheet1").Range("A1:A450")
For Each c In rng.Cells
c.Activate
Next c

By the way why do you want to do this, you don't actually need to select/activate cells/ranges to work with them.

Paleo
02-18-2005, 07:58 PM
Hi Tenspeed39355,

as you said you are going to use it with stock simbols I believe you want it to stay at each cell suficient time to read it, so I made this change to Nories code:



Dim rng As Range
Dim c As Range
Set rng = Worksheets("Sheet1").Range("A1:A8")
For Each c In rng.Cells
c.Activate
Application.Wait (Now + TimeValue("0:00:02")) 'This is the time it will remain at each cell
Next c

mdmackillop
02-20-2005, 01:49 PM
Hi Paleo,
I believe Max's query is related to this problem
http://www.vbaexpress.com/forum/showthread.php?t=1799
MD

Paleo
02-20-2005, 06:33 PM
Hi MD,

gee I didnt know that (he should have put a link to that post here), thanks.