Hello all,
I have a worksheet change code that will input the date, time, and users name into the log that they are working on, My challenge is that I am trying to automatically unhide the next row after input has been entered into column b of the last row filled in. I've found some options to hide or unhide all blanks, but that doesn't quite help me. Any assistance would be greatly appreciated.
Thanks - Drew!
I have a worksheet change code that will input the date, time, and users name into the log that they are working on, My challenge is that I am trying to automatically unhide the next row after input has been entered into column b of the last row filled in. I've found some options to hide or unhide all blanks, but that doesn't quite help me. Any assistance would be greatly appreciated.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim WorkRng As Range
Dim Rng As Range
Dim xOffsetColumn As Integer: Dim xOffsetColumn2 As Integer: Dim xOffsetColumn3 As Integer
Set WorkRng = Intersect(Application.ActiveSheet.Range("B9:B100000"), Target)
xOffsetColumn = 7
xOffsetColumn2 = 8
xOffsetColumn3 = 9
If Not WorkRng Is Nothing Then
Application.EnableEvents = False
For Each Rng In WorkRng
If Not VBA.IsEmpty(Rng.Value) Then
Rng.Offset(0, xOffsetColumn).Value = Now
Rng.Offset(0, xOffsetColumn).NumberFormat = "mm/dd/yyyy"
Rng.Offset(0, xOffsetColumn2).Value = Now
Rng.Offset(0, xOffsetColumn2).NumberFormat = "hh:mm:ss"
Rng.Offset(0, xOffsetColumn3).Value = Sheets("SECRET").Range("F4").Value
Else
Rng.Offset(0, xOffsetColumn).ClearContents
Rng.Offset(0, xOffsetColumn2).ClearContents
Rng.Offset(0, xOffsetColumn3).ClearContents
End If
Next
Application.EnableEvents = True
End If
End Sub
Thanks - Drew!