MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Visual basic active cell selection


Posted by John Der Garabedian on September 07, 2001 1:26 PM

Am trying to execute a simple code that places a time stamp into a cell, then moves to the next unprotected cell.

Something like enter this data, if current cell is in column b go to column d(same row) elseif
current column is column d goto column b(one row dowm).

Shouldn't be that hard, but I think I left my brain in my other car 'cause it sure isn't working today.

As always, THANK YOU.


Posted by Barrie Davidson on September 07, 2001 1:35 PM

If ActiveCell.Column = 2 Then
ActiveCell.Offset(0, 2).Select
ElseIf ActiveCell.Column = 4 Then
ActiveCell.Offset(1, -2).Select
End If


Regards,
Barrie

Posted by Juan Pablo on September 07, 2001 1:39 PM

If the sheet is protected, you could insert this line of code which will take you to the next Unlocked cell (Just like pressing TAB)

ActiveCell.Next.Activate

Good luck,

Juan Pablo