Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to move an activecell to down in a macro with VBasic

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'm making a macro in excel with visual basic code, I need to move an activecell to down, for example when you want to move an activecell to right write: activecell.next.select
or to left: activecell.previus.select, I can't find a way to move the activecell in another way.

Please this answer will help me a lot.
Bye.

P.D:If you want you can write me to:
cesar_soto@
 
You could use the offset ?

Sub Sample()
On Error Resume Next
'ActiveCell.Offset(Row reference, Col reference).Select
ActiveCell.Offset(-1, 0).Select 'Moves Up 1 Cell
ActiveCell.Offset(1, 0).Select 'Moves Down 1 cell
ActiveCell.Offset(0, -1).Select ' Moves left 1 Cell
ActiveCell.Offset(0, 1).Select ' Moves right 1 Cell

'This next example Moves right 1 Cell and Down 2
ActiveCell.Offset(2, 1).Select
End Sub
 
dont know if it will work in your situation, but you might also look at using the sendkeys in something like this:

SendKeys "{down}"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top