Hiya,
trying to jump from 1 workbook to another, starting in book1 jumping to book2 to copy a range from sheet "NUTS" and back to book1 to paste it into sheet "EUP."
I get subscript out of range. here's my code:
Can somebody tell me what I'm doing wrong?
trying to jump from 1 workbook to another, starting in book1 jumping to book2 to copy a range from sheet "NUTS" and back to book1 to paste it into sheet "EUP."
I get subscript out of range. here's my code:
Code:
Sub CopyTheHeader()
Application.Windows("book2.xls").Worksheets("NUTS").Activate 'fails here
Range("A1:Y10").Select
Selection.Copy
Application.Windows("book1.xls").Worksheets(2).Activate 'will fail here
Range("D1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
Can somebody tell me what I'm doing wrong?