andydtaylor
Active Member
- Joined
- Feb 15, 2007
- Messages
- 360
- Office Version
- 2016
Hi,
I'm trying to use best practice on a workbook whose name I know will get regularly changed as new versions are created. So I want to make sure it doesn't break and so have been sure to fully qualify my ranges, and make them workbook name change-proof.
However, I competely suck at understanding Excel's object model, and I still don't undersdtand when you should qualify things. So my 2-part query is -
1. Can anytone set me right on the best way to do the below? I have a version of this that works, but this doesn't look fully qualified to me.
2. Where's the best place to read an explanation of this qualification that's easy enough to digest so I have this down going forwards?
Thanks
Andy
Good
Bad # 1
Bad #2
I saw this thread and tried the following:
http://www.mrexcel.com/forum/excel-questions/304182-range-problem.html
I'm trying to use best practice on a workbook whose name I know will get regularly changed as new versions are created. So I want to make sure it doesn't break and so have been sure to fully qualify my ranges, and make them workbook name change-proof.
However, I competely suck at understanding Excel's object model, and I still don't undersdtand when you should qualify things. So my 2-part query is -
1. Can anytone set me right on the best way to do the below? I have a version of this that works, but this doesn't look fully qualified to me.
2. Where's the best place to read an explanation of this qualification that's easy enough to digest so I have this down going forwards?
Thanks
Andy
Good
Code:
Range("Gen_Sum_Old_bottom_side").Copy Destination:=Sheets(start_sheet).Range("A13")
Bad # 1
Code:
Workbooks(ThisWorkbook.Name).Worksheets(start_sheet).Range("Gen_Sum_Old_bottom_side").Copy _
Destination:=Workbooks(ThisWorkbook.Name).Worksheets("Delta_Gen").Range("A13")
Bad #2
I saw this thread and tried the following:
http://www.mrexcel.com/forum/excel-questions/304182-range-problem.html
Code:
Workbooks(ThisWorkbook.Name).Range("Gen_Sum_Old_bottom_side").Copy _
Destination:=Worksheets("Delta_Gen").Range("A13")