still learning
Well-known Member
- Joined
- Jan 15, 2010
- Messages
- 814
- Office Version
- 365
- Platform
- Windows
Hi
When I open a wookbook, and then open a spreadsheet, A Private sub worksheet_open macro sets up a title row and drops down to the last A:A cell that has data ( a date) in it. Then it drops one for me to enter a new date.
I then want an event macro to go up one cell (in “A”) and copy that date to Q2
Then when I enter data in “C” another event macro moves the cursor to “I”
Then when I enter data in “I” another event macro moves the cursor to “J”
“A” are dates
Q2 is part of a xlookup formula
This is what I have so far
This event macro works fine from …If target.column=3..
I’m trying to add the ..column=1 part
I don’t know how to copy the previous date to Q2 with out moving to Q2
mike
When I open a wookbook, and then open a spreadsheet, A Private sub worksheet_open macro sets up a title row and drops down to the last A:A cell that has data ( a date) in it. Then it drops one for me to enter a new date.
I then want an event macro to go up one cell (in “A”) and copy that date to Q2
Then when I enter data in “C” another event macro moves the cursor to “I”
Then when I enter data in “I” another event macro moves the cursor to “J”
“A” are dates
Q2 is part of a xlookup formula
This is what I have so far
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
ActiveCell.Offset(-1, 0).Range("A1").Select
' copy what is in the cell to Q2, then
ActiveCell.Offset(1, 0).Range("A1").Select
' this puts the cursor back to the cell that the new date was entered
If Target.Column = 3 Then
ActiveCell.Offset(0, 6).Range("A1").Select
If Target.Column = 6 Then
ActiveCell.Offset(0, 1).Range("A1").Select
End If
End If
End If
End Sub
I’m trying to add the ..column=1 part
I don’t know how to copy the previous date to Q2 with out moving to Q2
mike