Auto Date Stamp

data808

Active Member
Joined
Dec 3, 2010
Messages
353
Office Version
  1. 2019
Platform
  1. Windows
I am using this and it's working fine except I want it to do the date stamp but just not to row 1 because that is my title headers for each column:

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'for auto date stamp
With Target
    If .Count > 1 Then Exit Sub
    If Not Intersect(Range("D:F"), .Cells) Is Nothing The
    With Range("A" & Target.Row)
        If Not IsDate(.Value) Then
            ActiveSheet.Unprotect Password:="hello"
            .NumberFormat = "mm/dd/yyyy"
            .Value = Date
            ActiveSheet.Protect Password:="hello", DrawingObjects:=False, Contents:=True, Scenarios:= _
            False, AllowFormattingCells:=True, AllowFormattingColumns:=False, _
            AllowFormattingRows:=False, AllowInsertingColumns:=False, AllowInsertingRows _
            :=True, AllowInsertingHyperlinks:=True, AllowDeletingColumns:=False, _
            AllowDeletingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
            AllowUsingPivotTables:=True
        End If
    End With
    Application.EnableEvents = True
    End If
End With

End Sub

How would I change this code to not apply the date stamp for row 1? Thank you.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Update this condition:
VBA Code:
        If Not IsDate(.Value) Then
to this:
VBA Code:
        If (Not IsDate(.Value)) And (.Row > 1) Then
 
Upvote 1
Solution
You are welcome.
Glad I was able to help!
 
Upvote 0

Forum statistics

Threads
1,215,073
Messages
6,122,974
Members
449,095
Latest member
Mr Hughes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top