Vb6world

Visual Basic 6 world

Four simpe Excel User Functions to move the current cell around the sheet

Four simple functions to move the current selection right, left, up and down.

Sub MoveRight(Units As Long)
On Error Resume Next
ActiveCell.Offset(0, Units).Activate
End Sub
Sub MoveLeft(Units As Long)
On Error Resume Next
ActiveCell.Offset(0, -Units).Activate
End Sub
Sub MoveUp(Units As Long)
On Error Resume Next
ActiveCell.Offset(-Units, 0).Activate
End Sub
Sub MoveDown(Units As Long)
On Error Resume Next
ActiveCell.Offset(Units, 0).Activate
End Sub
Advertisements

November 11, 2008 Posted by | VBA | | Leave a comment