code to select a cell

Phil-e

Board Regular
Joined
Jun 28, 2004
Messages
65
Cant find this. I need code to move from one cell to another after data is entered. when I use [ Range ("C9").Select ] (as an example - without brackets) cell c9 is selected but when I try to move off the cell I can't. I am trying to unhide columns as I need them by entering data into different cells. I have that working fine and I would just like to be able to move to the next cell automatically.

Thanks in advance :biggrin:
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
You can do this:
[c9].select
...code here
[c10].slect
...code here

but "selecting" is resource hungry.

You can do almost anything without having to select it first.

Post your code, or explain in more detail what you want to do.
 
Upvote 0
Phil-e said:
move from one cell to another after data is entered. when I use [ Range ("C9").Select ] (as an example - without brackets) cell c9 is selected but when I try to move off the cell I can't.

Do you have code to post that you're currectly using? Are you entering data on a userform?

And I don't quite understand why you can't .Select another cell or use the cursor keys to manually scroll to another cell to enter data.
 
Upvote 0
This will move cells
Code:
 ActiveCell.Offset(0, 1).Select    ' next right
    ActiveCell.Offset(1, 0).Select    ' next down

You probably need to unhide colums first though.It's not clear what yo are doing. Entering data with code doesn't usually need the cells to be selected as has been pointed out.I don't follow the bit about unhidin
 
Upvote 0

Forum statistics

Threads
1,203,644
Messages
6,056,525
Members
444,872
Latest member
agutt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top