Cell Change

  • Thread starter Thread starter Luis
  • Start date Start date
L

Luis

Hello.
I want to run some VBA code when a user changes one cell.
Is it possible to capture the change event on a cell, or
the afterupdate event and run a certain VBA code?
If so, how can i do this? Note, the cell in question can
be anyone on the worksheet.

Thanks.
 
Luis,

The Worksheet_Change event which occurs every time you change something on a
worksheet, will do the job for you. Open the VB editor, select the
particular worksheet in the project explorer and put in the following:

Private Sub Worksheet_Change(ByVal Target As Range)
'Your code
'...
'...
End Sub

HTH,
Nikos
 
Just right click the tab at the bottom of your sheet choose view code
change the left hand drop down box to Worksheet and the right t
Change, now between the two lines on your sheet type Call your VB
code

Simo
 
Go to the Visual Basic editor and double click on the
worksheet you need to check on. The code window for the
sheet appears, with 2 drop down lists.

From the first list, Object, select Worksheet. From the
second list, Procedure, select Change. The
Worksheet_Change event appears.

Type your code in the event. To refer to the cell that
has changed, use Target.Address

HTH
Helen
 

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