next
02-25-2008, 04:22 PM
I'm confused, why is this generating me an error?
Public agesumCWI As Worksheet, agesumCLS As Worksheet
Sub editAgesum()
Sheets.Add.Name = "Licensing"
Sheets("agesum").Name = "Cleanway"
Set agesumCWI = ThisWorkbook.Worksheets("Cleanway")
Set agesumCLS = ThisWorkbook.Worksheets("Licensing")
agesumCWI.Move before:=agesumCLS
End Sub
Error: Out of Range.
Basically what i'm trying to achieve: I have a spreadsheet with 1 tab called "agesum", i'm adding a second tab called "Licensing", renaming "agesum" to "Cleanway" and then i'm assigning it to a var(2 of 'em).
It all works up to first "Set" statement.
Thanks for your help.
Public agesumCWI As Worksheet, agesumCLS As Worksheet
Sub editAgesum()
Sheets.Add.Name = "Licensing"
Sheets("agesum").Name = "Cleanway"
Set agesumCWI = ThisWorkbook.Worksheets("Cleanway")
Set agesumCLS = ThisWorkbook.Worksheets("Licensing")
agesumCWI.Move before:=agesumCLS
End Sub
Error: Out of Range.
Basically what i'm trying to achieve: I have a spreadsheet with 1 tab called "agesum", i'm adding a second tab called "Licensing", renaming "agesum" to "Cleanway" and then i'm assigning it to a var(2 of 'em).
It all works up to first "Set" statement.
Thanks for your help.