too many dates macro

G

Guest

Hi, was wondering if possible to modify a date script to exclude lines that
(?) have a period in the first cell? A$1..? Thanks

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Me.Range("AK:AK"), .Cells) Is Nothing Then
Application.EnableEvents = False
With Me.Cells(.Row, "AH")
.NumberFormat = "dd"
.Value = Now
End With
Application.EnableEvents = True
End If
If Not Intersect(Me.Range("AR:AU"), .Cells) Is Nothing Then
Application.EnableEvents = False
With Me.Cells(.Row, "AY")
.NumberFormat = "dd"
.Value = Now
End With
Application.EnableEvents = True
End If
End With
End Sub
 
D

Dave Peterson

Column A of the row that got the change?

With Target
If .Count > 1 Then Exit Sub
'just a dot?
if me.cells(.row,"A").value = "." then exit sub
'or contains a dot?
if instr(1,me.cells(.row,"A").value,".",vbtextcompare) > 0 then
exit sub
end if
If Not Intersect(Me.Range("AK:AK"), .Cells) Is Nothing Then
 
G

Guest

thankyou sir..

Dave Peterson said:
Column A of the row that got the change?

With Target
If .Count > 1 Then Exit Sub
'just a dot?
if me.cells(.row,"A").value = "." then exit sub
'or contains a dot?
if instr(1,me.cells(.row,"A").value,".",vbtextcompare) > 0 then
exit sub
end if
If Not Intersect(Me.Range("AK:AK"), .Cells) Is Nothing Then
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top