Work in 2 Cells "C3" and "R3"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello from Steved

Me.Range("C3") = Now is ok

Me.Range("C3:R3") = Now but this will not work

My objective is for it to Work in 2 Cells "C3" and "R3" is this possible
please. Thankyou

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("A3:AB272"), .Cells) Is Nothing Then
Application.EnableEvents = False
If Not IsEmpty(.Value) Then
Me.Range("C3:R3") = Now
End If
Application.EnableEvents = True
End If
End With
End Sub
 
It works for me.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("A3:AB272"), .Cells) Is Nothing Then
Application.EnableEvents = False
If Not IsEmpty(.Value) Then
Me.Range("C3,R3") = Now
End If
Application.EnableEvents = True
End If
End With
End Sub

Biff
 
What does "it is not working" mean? Does *anything* get entered in C3?
R3? Do the wrong values get added? Does XL crash?

When I try your code (using "C3,R3") it puts the date/time in both cell
C3 and cell R3.

What's different for you?
 
Hello Biff from Steved

When I put in Me.Range("C3,R3") = Now as instructed it did not work,
however when I closed the workbook and then reopened it it worked. I am very
sorry hopefully next time I will put the posted answer in my spreadsheet and
close then reopen.

Once again thankyou for your time.
 
Hello Gord form Steved

I was given the same formula by Biff earlier on but when I put it in it did
not work, however on closing the worksheet and then reopening it worked.
 
You shouldn't have to close then reopen for it to work. But I'm glad you got
it straightened out.

Thanks for the feedback!

Biff
 
Steve

Thanks for the feedback to all of us.

Just for info................

This is event code, not a "formula".


Gord
 

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

Back
Top