Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
too many dates macro
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 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
too many dates macro
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 nastech wrote: 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 -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
too many dates macro
thankyou sir..
"Dave Peterson" wrote: 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 nastech wrote: 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 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Editing a simple macro | Excel Worksheet Functions | |||
Make Alignment options under format cells available as shortcut | Excel Discussion (Misc queries) | |||
automatic macro update | Excel Worksheet Functions | |||
Macro and If Statement | Excel Discussion (Misc queries) | |||
Macro Formula revision? | Excel Worksheet Functions |