Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trigger a procedure on a cell change 1

Status
Not open for further replies.

billheath

Technical User
Mar 17, 2000
299
US
I'm a newbie - I have searched but I can not find the code for starting a procedure when someone changes a cell in Excel. This is easy in Access.
I think it has something to do with the worksheet change event.

I have tested the procedure and it works when run manually. It should run when someone changes the text in cell B156.
Thanks,

Help Please!!
 



Hi,

Yes, it is the Worksheet_Change event, when the target.address = range("B156").address or...
Code:
if not intersect(target, [B156]) is nothing then
   'correct cell changed
end if


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Thanks, Here is the code - Nothing happens!


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, [C156]) Is Nothing Then

Dim Txt, WkSh
CurrentCell = ActiveCell

WkSh = ActiveSheet.Name
Txt = ActiveCell.Text
Worksheets("June 08").Activate
Worksheets("June 08").Range("C156").Activate
ActiveCell.Value = Txt
Worksheets("July 08").Activate
Worksheets("July 08").Range("C156").Activate
ActiveCell.Value = Txt
Worksheets("Aug 08").Activate
Worksheets("Aug 08").Range("C156").Activate
ActiveCell.Value = Txt
Worksheets("Aug 08").Activate
Worksheets("Aug 08").Range("C156").Activate
ActiveCell.Value = Txt
Worksheets("Sept 08").Activate
Worksheets("Sept 08").Range("C156").Activate
ActiveCell.Value = Txt
Worksheets("Oct 08").Activate
Worksheets("Oct 08").Range("C156").Activate
ActiveCell.Value = Txt
Worksheets("Nov 08").Activate
Worksheets("Nov 08").Range("C156").Activate
ActiveCell.Value = Txt
'Worksheets("Dec 08").Activate
'Worksheets("Dec 08").Range("C156").Activate
'ActiveCell.Value = Txt

End If

End Sub
 




You have SelectionChange

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top