I've got a very large template workbook with quite a few worksheets which is used for preparing labor and expense estimates for projects and then for tracking actual labor costs and expenses against the estimate. I now have a new version of the spreadsheet and we want to migrate all the older version spreadsheets into the new template. I'm trying to write a macro that will do this quickly. The problem I've encountered are the duplicate named ranges in the two spreadsheets.
Copying the data isn't the problem. I use statements like the following to handle that:
Workbooks(estFileName).Sheets("Worksheet Estimate").Range(codeNameCell).Value = Workbooks(pwFileName).Sheets("Worksheet Estimate").Range(codeNameCell).Value
Where I have an issue is trying to use a the preexisting subroutines to add rows/columns to the new file based on the named ranges to make enough room for the data to be copied. I had hoped that the Range method would default to the active workbook, but that apparently isn't happening.
Is there an easy way (without having to go back and edit about 5,600 lines of code) to make the commands in the existing subroutines use the active workbook? I have tried the Windows(estFileName).Activate command to make the new file (estFileName) the active file, but that doesn't seem to be working.
Copying the data isn't the problem. I use statements like the following to handle that:
Workbooks(estFileName).Sheets("Worksheet Estimate").Range(codeNameCell).Value = Workbooks(pwFileName).Sheets("Worksheet Estimate").Range(codeNameCell).Value
Where I have an issue is trying to use a the preexisting subroutines to add rows/columns to the new file based on the named ranges to make enough room for the data to be copied. I had hoped that the Range method would default to the active workbook, but that apparently isn't happening.
Is there an easy way (without having to go back and edit about 5,600 lines of code) to make the commands in the existing subroutines use the active workbook? I have tried the Windows(estFileName).Activate command to make the new file (estFileName) the active file, but that doesn't seem to be working.