Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inefficient?
Is there a better way to write this??
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column < 1 And Target.Row < 1 And Target.Row < 2 And Target.Row < 3 And Target.Row < 4 Then Cells(Target.Row, 1).Value = Now End If End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inefficient?
This?
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column < 1 And Target.Row 4 Then Cells(Target.Row, 1).Value = Now End If End Sub "Steph" wrote: Is there a better way to write this?? Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column < 1 And Target.Row < 1 And Target.Row < 2 And Target.Row < 3 And Target.Row < 4 Then Cells(Target.Row, 1).Value = Now End If End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inefficient?
Thanks!
"Toppers" wrote in message ... This? Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column < 1 And Target.Row 4 Then Cells(Target.Row, 1).Value = Now End If End Sub "Steph" wrote: Is there a better way to write this?? Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column < 1 And Target.Row < 1 And Target.Row < 2 And Target.Row < 3 And Target.Row < 4 Then Cells(Target.Row, 1).Value = Now End If End Sub |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inefficient?
Don't forget events
Private Sub Worksheet_nChange(ByVal Target As Range) On Error GoTo ws_exit: Application.EnableEvents = False With Target If .Column < 1 And .Row 4 Then Cells(.Row, 1).Value = Now End If End With ws_exit: Application.EnableEvents = True End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Steph" wrote in message ... Thanks! "Toppers" wrote in message ... This? Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column < 1 And Target.Row 4 Then Cells(Target.Row, 1).Value = Now End If End Sub "Steph" wrote: Is there a better way to write this?? Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column < 1 And Target.Row < 1 And Target.Row < 2 And Target.Row < 3 And Target.Row < 4 Then Cells(Target.Row, 1).Value = Now End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Inefficient Space Removal | Excel Programming | |||
Inefficient Calculation of User Defined Functions in Excel 2000 | Excel Programming | |||
Loop worked but is it inefficient? | Excel Programming | |||
Loop worked but is it inefficient? | Excel Programming | |||
Inefficient VBA Code - Worksheets Property | Excel Programming |