SHEETMAGIC
Board Regular
- Joined
- May 3, 2005
- Messages
- 209
Hi there,
I have had to reinstall my whole XP system recently.
It's taking me some time to get excel back into the state I had it in before reinstalling... It was set up to do all the various things I like and need. If only I could recall exactly everything I had done to get there !!
Anyway...
I am getting an error on code that used to run just fine. The code has not changed... only Excel has changed.
This line generates the error: ActiveSheet.Name = nn
The error I get is:
"Run time error: '1004'
Application-defined or object-defined error"
Please let me know what simple change I need to make to excel to get this to work as it use to. Your help is greatly appreciated.
I am using Excel 2003 SP3.
With my thanks and regards,
Jonathan[/code]
I have had to reinstall my whole XP system recently.
It's taking me some time to get excel back into the state I had it in before reinstalling... It was set up to do all the various things I like and need. If only I could recall exactly everything I had done to get there !!
Anyway...
I am getting an error on code that used to run just fine. The code has not changed... only Excel has changed.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim nn As String, sht As Worksheet
If Not Intersect(Target, Range("H9:J10")) Is Nothing Then
nn = ActiveSheet.Range("R6")
ActiveSheet.Name = "Correct the week date"
If SheetExists(nn) Then
MsgBox ("This date already exists. Please pick another end date")
Else
ActiveSheet.Name = nn
End If
End If
End Sub
This line generates the error: ActiveSheet.Name = nn
The error I get is:
"Run time error: '1004'
Application-defined or object-defined error"
Please let me know what simple change I need to make to excel to get this to work as it use to. Your help is greatly appreciated.
I am using Excel 2003 SP3.
With my thanks and regards,
Jonathan[/code]