Auto Date Stamp

data808

Active Member
Joined
Dec 3, 2010
Messages
358
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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
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,223,705
Messages
6,173,989
Members
452,541
Latest member
haasro02

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