still learning
Well-known Member
- Joined
- Jan 15, 2010
- Messages
- 784
- Office Version
- 365
- Platform
- Windows
Hi
I'm wondering if I can have an event change macro only run ones until the spread sheet is closed, then when it's opened again the event change macro will again run, once
as an example, here is an event change macro
I open the spreadsheet and enter data in A5,
the cursor moves automatically 2 cells to the right.
If I then enter data in A6, I don't want the event change to work.
The next time I open the spreadsheet, I enter data in A6, the same thing happens, the macro will only run once
mike
I'm wondering if I can have an event change macro only run ones until the spread sheet is closed, then when it's opened again the event change macro will again run, once
as an example, here is an event change macro
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Long
If Not Intersect(Target, Range("A5:A30")) Is Nothing Then
Target.Offset(0, 2).Select
End If
End sub
the cursor moves automatically 2 cells to the right.
If I then enter data in A6, I don't want the event change to work.
The next time I open the spreadsheet, I enter data in A6, the same thing happens, the macro will only run once
mike