Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
Application.EnableEvents = False
Target.Offset(ColumnOffset:=IIf(Target.Value = "Cell", 3, 2)).Select
Application.EnableEvents = True
End Sub
How to install Worksheet Event Handlers
Worksheet event handlers must be installed in the module of a specific sheet:
How to install your new code- Copy the Excel VBA code
- Select the worksheet in which you want the VBA macro to run
a) If the Visual Basic Editor is not open, right click the sheet tab and select "View Code"
b) If the VBE is already opened, double click the desired sheet in the project pane.
- Press Alt+F11 to open the Visual Basic Editor
- Choose Insert > Module
- Edit > Paste the macro into the module that appeared
- Close the VBEditor
- Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)
Bookmarks