Hi Hope you can help me - I'm tearing my hair out here.
I have this (Possibly uneloquent) code:
When a value is entered in row 'K' I want the code to insert the date in row 'Z' and the Time in row 'AA' then Hide those two columns. That works fine, but when it's done it selects cell 'B3' for some reason. How would I write a line into that code that selects the next non blank cell in Column 'L'.
Hope this makes sense.
I have this (Possibly uneloquent) code:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
ActiveSheet.Unprotect
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("K3:K100")) Is Nothing Then
With Target(1, 16)
.Value = Date
.EntireColumn.AutoFit
End With
End If
If Not Intersect(Target, Range("K3:K100")) Is Nothing Then
With Target(1, 17)
.Value = Time
.EntireColumn.AutoFit
Columns("Z:AC").Select
Selection.EntireColumn.Hidden = True
ActiveSheet.protect
Application.ScreenUpdating = True
End With
End If
End Sub
When a value is entered in row 'K' I want the code to insert the date in row 'Z' and the Time in row 'AA' then Hide those two columns. That works fine, but when it's done it selects cell 'B3' for some reason. How would I write a line into that code that selects the next non blank cell in Column 'L'.
Hope this makes sense.