Hi,
im trying to create some universal code i can use on other projects the sheets are named after people when i write my code using these names it works perfect but when i change it to reflect the sheet number it gives me an error.
WORKS:
DOESN'T WORK:
am i referencing the sheet numbers wrong? Is it possible to write working code this way (referencing the sheet number instead of the name)
Thanks in advance
im trying to create some universal code i can use on other projects the sheets are named after people when i write my code using these names it works perfect but when i change it to reflect the sheet number it gives me an error.
WORKS:
Code:
Sub copyLink()
' copyLink Macro
' Macro recorded 8/31/2006 by
Sheets("gowans").Range("A5:P31").Copy
Sheets("Total Sheet").Range("A5:P31").Select
ActiveSheet.Paste Link:=True
End Sub
DOESN'T WORK:
Code:
Sub copyLink()
' copyLink Macro
' Macro recorded 8/31/2006 by
Sheets("sheet1").Range("A5:P31").Copy
Sheets("sheet13").Range("A5:P31").Select
ActiveSheet.Paste Link:=True
End Sub
am i referencing the sheet numbers wrong? Is it possible to write working code this way (referencing the sheet number instead of the name)
Thanks in advance