PDA

View Full Version : [SOLVED:] Target.Cells.Count - Change to Read a Range - VBA



jnix612
01-11-2021, 08:54 AM
Good day, I am not a VBA person. I know how to make small adjustments. I did try to find the answer but I'm stuck. I would like the below VBA to auto populate date/time if data is entered or pasted into B2-I2. The table range is B2:I16. Currently it only triggers if data is entered into column 1 (B). Your assistance would be is greatly appreciated.


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A2:A15")) Is Nothing Then
With Target(1, 2)
.Value = Date & " " & Time
.EntireColumn.AutoFit
End With
End If
End Sub

jnix612
01-11-2021, 11:06 AM
HA! Never mind I found the VBA to fix my problem. :clap:

If Intersect(Target, Range("B2:I16")) Is Nothing Then Exit Sub