G
Guest
Guest
Hello, can anyone out there see a reason the following code would fail? I had the EXACT code in another macro that worked fine. I have gone through this macro line by line and all works well except the second (and probably 2nd to last) lines refering to shtOriginal. What happens is that when I run the macro it will debug with the 2nd line 'shtOriginal' phrase highlighted and the error message 'variable not defined'. The purpose of the second and 2nd to last line is so that after the info is copied and pasted to the '5th worksheet' I want it to then return to WHICHEVER of the worksheets (1-4) the user was last on.
Sub HELP()
'
' CutPaste Macro
' Macro recorded 26/02/2002 by
'
'
Application.ScreenUpdating = False
shtOriginal = ActiveSheet.Name
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Copy
Sheets("My Class").Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
With Selection.Font
.Name = "Arial"
.Size = 8
End With
Sheets(shtOriginal).Select
ActiveCell.Offset(1, 1).Activate
Application.ScreenUpdating = True
End Sub
Any ideas? Many thanks if so!
Sub HELP()
'
' CutPaste Macro
' Macro recorded 26/02/2002 by
'
'
Application.ScreenUpdating = False
shtOriginal = ActiveSheet.Name
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Copy
Sheets("My Class").Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
With Selection.Font
.Name = "Arial"
.Size = 8
End With
Sheets(shtOriginal).Select
ActiveCell.Offset(1, 1).Activate
Application.ScreenUpdating = True
End Sub
Any ideas? Many thanks if so!