Consulting

Results 1 to 2 of 2

Thread: Target.Cells.Count - Change to Read a Range - VBA

  1. #1
    VBAX Regular
    Joined
    Apr 2017
    Posts
    77
    Location

    Question Target.Cells.Count - Change to Read a Range - VBA

    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

  2. #2
    VBAX Regular
    Joined
    Apr 2017
    Posts
    77
    Location
    HA! Never mind I found the VBA to fix my problem.

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •