Greetings,
I'm having an issue with the Worksheet_Change event.
When the user changes a specific value in the worksheet, I need to 'save' that new value to another worksheet unless it is already that same value.
t_SP1Class <- named cell in the current worksheet that I need to check
res_SpellListForSP <- named cell in another worksheet that HAS to hold the same value as t_SP1Class . If it already contains that value, then do nothing and exit.
Here is the code I am using, highlighting the
This generates an "Application-defined or object-defined" error #1004 when I try to assign a new value to res_SpellListForSP.
I.E on the Application.Names("res_SpellListForSP").RefersToRange = Application.Names("t_SP1Class").RefersToRange line.
This problem is similar to this knowledge base article, yet that approach does not seem to solve my problem. How can I adapt to work around this?
Thank you for any assistance!!
RiTz21
I'm having an issue with the Worksheet_Change event.
When the user changes a specific value in the worksheet, I need to 'save' that new value to another worksheet unless it is already that same value.
t_SP1Class <- named cell in the current worksheet that I need to check
res_SpellListForSP <- named cell in another worksheet that HAS to hold the same value as t_SP1Class . If it already contains that value, then do nothing and exit.
Here is the code I am using, highlighting the
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Oups:
If Application.Names("t_SP1Class").RefersToRange <> Application.Names("res_SpellListForSP").RefersToRange Then
Application.Names("res_SpellListForSP").RefersToRange = Application.Names("t_SP1Class").RefersToRange
End If
Exit Sub
Oups:
MsgBox Err.Description & " " & Err.Number
End Sub
I.E on the Application.Names("res_SpellListForSP").RefersToRange = Application.Names("t_SP1Class").RefersToRange line.
This problem is similar to this knowledge base article, yet that approach does not seem to solve my problem. How can I adapt to work around this?
Thank you for any assistance!!
RiTz21