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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running worksheet code/macro when "1 cell's" value is changes 1

Status
Not open for further replies.

wwgmr

MIS
Mar 12, 2001
174
US
Hi all, this should be simple, I am trying to write a code that will run to auto size my column when a cell is changed on different sheet. I don't want to run a on selection change code so that everytime I change anything on the workbook the code is running. I just want it when a few select cells are changed. I have the cells named in excel. So I can use the names in code. Cells are say c2 thru c6 and d5:d6. Names are Case1, case2 ext..


Thanks alot for the help!

Eric
 
I believe the only option available to you is the WorkSheet_Change event handling procedures that runs when ever the value of ANY cell on the Worksheet changes.

Private Sub Worksheet_Change(ByVal Target As Range)
For Each c In Range("C2:C6,D5:D6")
If c.Address = Target.Address Then
MsgBox "Change Detected - Run Resize routine"
End If
Next c
End Sub
 
Thanks Kevin I had feeling that it was way I was going to have to go. Just trying to cut back on the "Noise" as they say. Thanks for info though.

Eric
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top