Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi, i need this code to run from "A5".
Can this be done? Thanks! Private Sub Worksheet_Change(ByVal Target As Excel.Range) 'when entering data in a cell in Col A On Error GoTo enditall Application.EnableEvents = False If Target.Cells.Column = 1 Then N = Target.Row If Me.Range("A" & N).Value < "" Then With Me.Range("B" & N) If .Value = "" Then ..Value = Now End If End With End If End If enditall: Application.EnableEvents = True End Sub |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
try to replace
If Target.Cells.Column = 1 Then with If Target.Cells.Column = 1 And Target.Cells.Row = 5 Then On 8 Kwi, 14:20, puiuluipui wrote: Hi, i need this code to run from "A5". Can this be done? Thanks! Private Sub Worksheet_Change(ByVal Target As Excel.Range) 'when entering data in a cell in Col A On Error GoTo enditall Application.EnableEvents = False If Target.Cells.Column = 1 Then N = Target.Row If Me.Range("A" & N).Value < "" Then With Me.Range("B" & N) If .Value = "" Then .Value = Now End If End With End If End If enditall: Application.EnableEvents = True End Sub |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Its working! Thanks!
"Jarek Kujawa" a scris: try to replace If Target.Cells.Column = 1 Then with If Target.Cells.Column = 1 And Target.Cells.Row = 5 Then On 8 Kwi, 14:20, puiuluipui wrote: Hi, i need this code to run from "A5". Can this be done? Thanks! Private Sub Worksheet_Change(ByVal Target As Excel.Range) 'when entering data in a cell in Col A On Error GoTo enditall Application.EnableEvents = False If Target.Cells.Column = 1 Then N = Target.Row If Me.Range("A" & N).Value < "" Then With Me.Range("B" & N) If .Value = "" Then .Value = Now End If End With End If End If enditall: Application.EnableEvents = True End Sub |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Add
if target.row < 6 then exit sub right near the top. puiuluipui wrote: Hi, i need this code to run from "A5". Can this be done? Thanks! Private Sub Worksheet_Change(ByVal Target As Excel.Range) 'when entering data in a cell in Col A On Error GoTo enditall Application.EnableEvents = False If Target.Cells.Column = 1 Then N = Target.Row If Me.Range("A" & N).Value < "" Then With Me.Range("B" & N) If .Value = "" Then .Value = Now End If End With End If End If enditall: Application.EnableEvents = True End Sub -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Its working! Thanks!
"Dave Peterson" a scris: Add if target.row < 6 then exit sub right near the top. puiuluipui wrote: Hi, i need this code to run from "A5". Can this be done? Thanks! Private Sub Worksheet_Change(ByVal Target As Excel.Range) 'when entering data in a cell in Col A On Error GoTo enditall Application.EnableEvents = False If Target.Cells.Column = 1 Then N = Target.Row If Me.Range("A" & N).Value < "" Then With Me.Range("B" & N) If .Value = "" Then .Value = Now End If End With End If End If enditall: Application.EnableEvents = True End Sub -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to use a range name in a macro | Excel Worksheet Functions | |||
Macro deletes row in range, macro then skips the row moved up | Excel Discussion (Misc queries) | |||
macro pop-up to set range? | Excel Worksheet Functions | |||
Macro Range | Excel Discussion (Misc queries) | |||
Name a Range - Macro | Excel Worksheet Functions |