Macro range

P

puiuluipui

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
 
J

Jarek Kujawa

try to replace

If Target.Cells.Column = 1 Then

with

If Target.Cells.Column = 1 And Target.Cells.Row = 5 Then
 
P

puiuluipui

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
 

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

Top