R
rob nobel
Greetings all.
I have 2 workbooks exactly the same as each other except that one is the
workbook with the info whilst the other is in the form of a template.
In the first workbook I would like to copy values and paste them to the
Template file; to the same location (Sheet name, columns, etc.)
I can't seem to do this in one hit by either:
1. Copying sheet to Template file. As it copies all the fomulas and links
them back to the workbook.
2. Copying the columns in one hit. As when pasting them, they are pasted
contiguously, overwriting other columns.
As I'm copying about 5 columns I'd like to know if there's a better way to
do this then by the following code (for each column).
'TRANSFER VALUES TO NEW BOOK
'Copy Closing value from old to opening value in new.
Windows("Records (CURRENT YEAR).xls").Activate
Sheets("Depreciation").Range("J5:J31").Copy
Windows("Records1").Activate
Sheets("Depreciation").Range("J5").PasteSpecial Paste:=xlValues
So, is there a better way please?
PS. It's only important if the code would be a lot shorter than the above
code (x 5), as this works fine, but I just want to reduce the size of the
code.
Rob
I have 2 workbooks exactly the same as each other except that one is the
workbook with the info whilst the other is in the form of a template.
In the first workbook I would like to copy values and paste them to the
Template file; to the same location (Sheet name, columns, etc.)
I can't seem to do this in one hit by either:
1. Copying sheet to Template file. As it copies all the fomulas and links
them back to the workbook.
2. Copying the columns in one hit. As when pasting them, they are pasted
contiguously, overwriting other columns.
As I'm copying about 5 columns I'd like to know if there's a better way to
do this then by the following code (for each column).
'TRANSFER VALUES TO NEW BOOK
'Copy Closing value from old to opening value in new.
Windows("Records (CURRENT YEAR).xls").Activate
Sheets("Depreciation").Range("J5:J31").Copy
Windows("Records1").Activate
Sheets("Depreciation").Range("J5").PasteSpecial Paste:=xlValues
So, is there a better way please?
PS. It's only important if the code would be a lot shorter than the above
code (x 5), as this works fine, but I just want to reduce the size of the
code.
Rob