logandiana
Board Regular
- Joined
- Feb 21, 2017
- Messages
- 107
I have to enter 4 strings of around 1000 or so rows in to column 1.
So for example if the 4 strings were exactly 1000 (which they'll never be), then I enter in cell A1 and the code would automatically select A1001 for the next set of data.
I don't want to scroll to the bottom after each time so I created a worksheet change event.
I made this code:
It works the way I want it to, but after the 4th instance of adding data I want it to snap back up to the top and select cell(1,1).
How do I do that?
And also how do I turn this worksheet event off afterwards to keep it from interfering with my main macro?
So for example if the 4 strings were exactly 1000 (which they'll never be), then I enter in cell A1 and the code would automatically select A1001 for the next set of data.
I don't want to scroll to the bottom after each time so I created a worksheet change event.
I made this code:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim LR As Long
LR = Sheets("Data").Cells(Rows.Count, 1).End(xlUp).Row
With Sheets("Data")
.Cells(LR + 1, 1).Select
End With
End Sub
How do I do that?
And also how do I turn this worksheet event off afterwards to keep it from interfering with my main macro?