![]() |
On Cell change call
I am trying to call a sub whenever a single cell of a worksheet is changed.
I know how to do that whenever ANY cell on a worksheet is changed, but is there a way to only call the sub when a SPECIFIC cell is changed. For example, is cell 'b10" (labeled CRN) is changed, I want to call a sub, on the same worksheet, called "FindCRN". Can anyone give me any suggestions? TIA, Ken |
On Cell change call
Try something similar to this in a Worksheet Change event:
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$B$10" Then FindCRN End Sub -- Damon Longworth Don't miss out on the 2005 Excel User Conference Sept 16th and 17th Stockyards Hotel - Ft. Worth, Texas www.ExcelUserConference.com "Ken Loomis" wrote in message ... I am trying to call a sub whenever a single cell of a worksheet is changed. I know how to do that whenever ANY cell on a worksheet is changed, but is there a way to only call the sub when a SPECIFIC cell is changed. For example, is cell 'b10" (labeled CRN) is changed, I want to call a sub, on the same worksheet, called "FindCRN". Can anyone give me any suggestions? TIA, Ken |
On Cell change call
Thanks, Damon. That works well.
I am still laying out the user input worksheet, so I was hoping I could change this: If Target.Address = "$B$10" Then FindCRN to If Target.Address = "CRN" Then FindCRN since 'CRN' is the label for that cell. I tried that but it doesn't work. Is there a way to change that statement to test to see if the call labeled "CRN" has been changed? Or, will I just need to update the "$B$10" whenever I add rows or columns to the finished spreadsheet.? Ken "Damon Longworth" wrote in message ... Try something similar to this in a Worksheet Change event: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$B$10" Then FindCRN End Sub -- Damon Longworth Don't miss out on the 2005 Excel User Conference Sept 16th and 17th Stockyards Hotel - Ft. Worth, Texas www.ExcelUserConference.com "Ken Loomis" wrote in message ... I am trying to call a sub whenever a single cell of a worksheet is changed. I know how to do that whenever ANY cell on a worksheet is changed, but is there a way to only call the sub when a SPECIFIC cell is changed. For example, is cell 'b10" (labeled CRN) is changed, I want to call a sub, on the same worksheet, called "FindCRN". Can anyone give me any suggestions? TIA, Ken |
On Cell change call
Hi Ken,
One way: Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo XIT If Not Intersect(Target, Me.Range("CRN")) _ Is Nothing Then Call FindCRN End If On Error GoTo 0 XIT: End Sub --- Regards, Norman "Ken Loomis" wrote in message ... Thanks, Damon. That works well. I am still laying out the user input worksheet, so I was hoping I could change this: If Target.Address = "$B$10" Then FindCRN to If Target.Address = "CRN" Then FindCRN since 'CRN' is the label for that cell. I tried that but it doesn't work. Is there a way to change that statement to test to see if the call labeled "CRN" has been changed? Or, will I just need to update the "$B$10" whenever I add rows or columns to the finished spreadsheet.? Ken "Damon Longworth" wrote in message ... Try something similar to this in a Worksheet Change event: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$B$10" Then FindCRN End Sub -- Damon Longworth Don't miss out on the 2005 Excel User Conference Sept 16th and 17th Stockyards Hotel - Ft. Worth, Texas www.ExcelUserConference.com "Ken Loomis" wrote in message ... I am trying to call a sub whenever a single cell of a worksheet is changed. I know how to do that whenever ANY cell on a worksheet is changed, but is there a way to only call the sub when a SPECIFIC cell is changed. For example, is cell 'b10" (labeled CRN) is changed, I want to call a sub, on the same worksheet, called "FindCRN". Can anyone give me any suggestions? TIA, Ken |
On Cell change call
If Not Intersect(Target, Range("CRN")) Is Nothing Then FindCRN
-- HTH RP (remove nothere from the email address if mailing direct) "Ken Loomis" wrote in message ... Thanks, Damon. That works well. I am still laying out the user input worksheet, so I was hoping I could change this: If Target.Address = "$B$10" Then FindCRN to If Target.Address = "CRN" Then FindCRN since 'CRN' is the label for that cell. I tried that but it doesn't work. Is there a way to change that statement to test to see if the call labeled "CRN" has been changed? Or, will I just need to update the "$B$10" whenever I add rows or columns to the finished spreadsheet.? Ken "Damon Longworth" wrote in message ... Try something similar to this in a Worksheet Change event: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$B$10" Then FindCRN End Sub -- Damon Longworth Don't miss out on the 2005 Excel User Conference Sept 16th and 17th Stockyards Hotel - Ft. Worth, Texas www.ExcelUserConference.com "Ken Loomis" wrote in message ... I am trying to call a sub whenever a single cell of a worksheet is changed. I know how to do that whenever ANY cell on a worksheet is changed, but is there a way to only call the sub when a SPECIFIC cell is changed. For example, is cell 'b10" (labeled CRN) is changed, I want to call a sub, on the same worksheet, called "FindCRN". Can anyone give me any suggestions? TIA, Ken |
On Cell change call
Thanks, Bob.
That worked great. Ken "Bob Phillips" wrote in message ... If Not Intersect(Target, Range("CRN")) Is Nothing Then FindCRN -- HTH RP (remove nothere from the email address if mailing direct) "Ken Loomis" wrote in message ... Thanks, Damon. That works well. I am still laying out the user input worksheet, so I was hoping I could change this: If Target.Address = "$B$10" Then FindCRN to If Target.Address = "CRN" Then FindCRN since 'CRN' is the label for that cell. I tried that but it doesn't work. Is there a way to change that statement to test to see if the call labeled "CRN" has been changed? Or, will I just need to update the "$B$10" whenever I add rows or columns to the finished spreadsheet.? Ken "Damon Longworth" wrote in message ... Try something similar to this in a Worksheet Change event: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$B$10" Then FindCRN End Sub -- Damon Longworth Don't miss out on the 2005 Excel User Conference Sept 16th and 17th Stockyards Hotel - Ft. Worth, Texas www.ExcelUserConference.com "Ken Loomis" wrote in message ... I am trying to call a sub whenever a single cell of a worksheet is changed. I know how to do that whenever ANY cell on a worksheet is changed, but is there a way to only call the sub when a SPECIFIC cell is changed. For example, is cell 'b10" (labeled CRN) is changed, I want to call a sub, on the same worksheet, called "FindCRN". Can anyone give me any suggestions? TIA, Ken |
All times are GMT +1. The time now is 02:11 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com