PDA

View Full Version : Solved: Moving to a specific cell with VBA



smugdruggler
06-06-2006, 03:03 PM
I have a spreadsheet that captures data from a device. This puts measurements into adjacent columns say A1,B1,C1 then moves to the next cell in column A, in this case A2. The procedure then repeats itself for 15 measurements. When the measurements finish the active cell is set at A16, I then have to click back on A1 to start measurement again.

I would like to automatically move back to cell A1, could someone help point me in the right direction because I'm obviously missing something. By protecting the sheet, and unprotecting the range A1:C15 I can get back to cell B1, close - but no cigar!

Any advice gratefully received.

mdmackillop
06-06-2006, 03:07 PM
Hi Smug,
Welcome to VBAX

Add the line

[A1].Activate
at the end of your macro
Regards
MD

YellowLabPro
06-07-2006, 09:33 PM
MD,
What is the difference in your method and Range("A1").Select ? Other than more typing....

mdmackillop
06-07-2006, 11:00 PM
Hi YLP,
None at all in practical terms. Of course Activate will work only with one cell, which may not be appropriate in all situations.
Regards
MD

smugdruggler
06-08-2006, 12:36 AM
Thanks MD,

I just added the Activate the cell change event and it worked a treat :o)

geekgirlau
06-09-2006, 02:36 AM
Don't forget to mark this thread as "Solved" - go to the "Thread Tools" option at the top of the screen.