ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Work in 2 Cells "C3" and "R3" (https://www.excelbanter.com/excel-worksheet-functions/143750-work-2-cells-c3-r3.html)

Steved

Work in 2 Cells "C3" and "R3"
 
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

T. Valko

Work in 2 Cells "C3" and "R3"
 
Try this:

Me.Range("C3,R3") = Now

Biff

"Steved" wrote in message
...
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




Steved

Work in 2 Cells "C3" and "R3"
 
Hello Biff from Steved

I tried ("C3,R3") but it is not working.



"T. Valko" wrote:

Try this:

Me.Range("C3,R3") = Now

Biff

"Steved" wrote in message
...
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





T. Valko

Work in 2 Cells "C3" and "R3"
 
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

"Steved" wrote in message
...
Hello Biff from Steved

I tried ("C3,R3") but it is not working.



"T. Valko" wrote:

Try this:

Me.Range("C3,R3") = Now

Biff

"Steved" wrote in message
...
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







JE McGimpsey

Work in 2 Cells "C3" and "R3"
 
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?

In article ,
Steved wrote:

I tried ("C3,R3") but it is not working.


Gord Dibben

Work in 2 Cells "C3" and "R3"
 
Me.Range("C3,R3") = Now


Gord Dibben MS Excel MVP

On Tue, 22 May 2007 19:44:01 -0700, Steved
wrote:

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



Steved

Work in 2 Cells "C3" and "R3"
 
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.


"T. Valko" wrote:

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

"Steved" wrote in message
...
Hello Biff from Steved

I tried ("C3,R3") but it is not working.



"T. Valko" wrote:

Try this:

Me.Range("C3,R3") = Now

Biff

"Steved" wrote in message
...
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







Steved

Work in 2 Cells "C3" and "R3"
 
Hello Je from Steved

I closed the worksheet and reopened it and now works. My Fault.

"JE McGimpsey" wrote:

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?

In article ,
Steved wrote:

I tried ("C3,R3") but it is not working.



Steved

Work in 2 Cells "C3" and "R3"
 
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.

"Gord Dibben" wrote:

Me.Range("C3,R3") = Now


Gord Dibben MS Excel MVP

On Tue, 22 May 2007 19:44:01 -0700, Steved
wrote:

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




T. Valko

Work in 2 Cells "C3" and "R3"
 
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

"Steved" wrote in message
...
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.


"T. Valko" wrote:

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

"Steved" wrote in message
...
Hello Biff from Steved

I tried ("C3,R3") but it is not working.



"T. Valko" wrote:

Try this:

Me.Range("C3,R3") = Now

Biff

"Steved" wrote in message
...
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









Gord Dibben

Work in 2 Cells "C3" and "R3"
 
Steve

Thanks for the feedback to all of us.

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

This is event code, not a "formula".


Gord

On Wed, 23 May 2007 12:46:05 -0700, Steved
wrote:

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.

"Gord Dibben" wrote:

Me.Range("C3,R3") = Now


Gord Dibben MS Excel MVP

On Tue, 22 May 2007 19:44:01 -0700, Steved
wrote:

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






All times are GMT +1. The time now is 12:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com