View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default OnChange function only when a certain cell changes

I'm glad it works. For more information about events, see
http://www.cpearson.com/excel/events.htm .


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


"PCLIVE" wrote in message
...
Great idea Chip!
Works great!

Thank you,
Paul

"Chip Pearson" wrote in message
...
Paul,

Forget about OnChange. Instead, use the Worksheet_Change event
procedure (right click on the appropriate sheet tab and choose
View Code). Something like

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
' do something
End If
End Sub



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


"PCLIVE" wrote in message
...
Can I do an OnChange function for just one cell? For
example, anytime A1 changes, I'd like to run some code. I
don't really want to use the code on the whole sheet if I
don't have to. Can this be done?

Thanks,
Paul