View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Ram Ram is offline
external usenet poster
 
Posts: 138
Default Worksheet_Change

Chip,

That was the problem.

Thanks for your time and help

"Chip Pearson" wrote:

It should work. It is possible that events got disabled. In the
Immediate window in VBA (CTRL+g), type the following and then
press Enter.

Application.EnableEvents = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"ram" wrote in message
...
Chip,

I copied in your code and I still have no data in range("A2").
When I first
tried this function early this morning it was working for me.
Do you have
any other ideas why this would stop working.
I have tried a veriety of code from the user group, your site
and dmcritchie
site none seem to return any data.

Thanks for your help

"Chip Pearson" wrote:

You need to use the Address property to determine what cell
was
change. E.g.,

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Application.EnableEvents = False
Range("A2").Value = Now
Application.EnableEvents = True
End If
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"ram" wrote in message
...
I have been trying to use the following code but for some
reason
Nothing is
happening when I make a change to cell ("A1"). I pasted the
code in a module,
and clicked on the sheet1 and right clicked the mouse to
view
the code and
pasted it in. Can someone tell me what i'm doing wrong.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target = Cells(1, 1) Then Cells(2, 1) = Now
End Sub 'alternatives: NOW() or date or Time

Thanks for any help