Hi, i recorded a macro to copy data in one worksheet (Input File) into another (Calculation).
The way that I did it was one cell at a time so for instance cell D2 in the 'Input File' worksheet was copied to cell D4 in the 'Calculation' worksheet.
This is repeated across a number of cells in the 'Input File' worksheet.
Can someone please help with the code to copy all the required cells in one hit (ie for all the cells required in the 'Input File' worksheet rather than going backwards and forwards between the sheets) and them paste them to the appropriate cells in the 'Calculation' worksheet in one hit.
Below is a subset of the code that I have (in this example there are 3 cells to copy but I will actually require to copy about 10 cells in one go).
Sub IFRS_Calculations()
‘ IFRS_Calculations Macro
‘ Macro recorded 10/11/2005 by spraggn1
Sheets("Input File").Select
Range("D2").Select
Range("D2").Copy
Sheets("Calculation").Select
Range("D4").Select
ActiveSheet.Paste
Sheets("Input File").Select
Range("F2").Select
Range("F2").Copy
Sheets("Calculation").Select
Range("D8").Select
ActiveSheet.Paste
Sheets("Input File").Select
Range("J2").Select
Range("J2").Copy
Sheets("Calculation").Select
Range("D10").Select
ActiveSheet.Paste
End Sub
Eg the spreadsheets have the following data (I have only included the 3 cells in the code above but there is data in A1:AF1 in the 'Input File' worksheet and I need to copy about 10 of them, which are not all adjacent)
'Input File' worksheet
D2 F2 J2
AASB139 1 0.007791666666667
'Calculation' worksheet
D4 (Accounting standard) - InputFile!D2 to be pasted
D8 (Balance) - InputFile!F2 to be pasted
D10 (Discount Rate) - InputFile!J2 to be pasted
Please note the mappings of the cells to copy from in the 'Input File' and then paste to in the 'Calculations' worksheet are vital to the operation
Any help would be greatly appreciated
Thanks
Nick
The way that I did it was one cell at a time so for instance cell D2 in the 'Input File' worksheet was copied to cell D4 in the 'Calculation' worksheet.
This is repeated across a number of cells in the 'Input File' worksheet.
Can someone please help with the code to copy all the required cells in one hit (ie for all the cells required in the 'Input File' worksheet rather than going backwards and forwards between the sheets) and them paste them to the appropriate cells in the 'Calculation' worksheet in one hit.
Below is a subset of the code that I have (in this example there are 3 cells to copy but I will actually require to copy about 10 cells in one go).
Sub IFRS_Calculations()
‘ IFRS_Calculations Macro
‘ Macro recorded 10/11/2005 by spraggn1
Sheets("Input File").Select
Range("D2").Select
Range("D2").Copy
Sheets("Calculation").Select
Range("D4").Select
ActiveSheet.Paste
Sheets("Input File").Select
Range("F2").Select
Range("F2").Copy
Sheets("Calculation").Select
Range("D8").Select
ActiveSheet.Paste
Sheets("Input File").Select
Range("J2").Select
Range("J2").Copy
Sheets("Calculation").Select
Range("D10").Select
ActiveSheet.Paste
End Sub
Eg the spreadsheets have the following data (I have only included the 3 cells in the code above but there is data in A1:AF1 in the 'Input File' worksheet and I need to copy about 10 of them, which are not all adjacent)
'Input File' worksheet
D2 F2 J2
AASB139 1 0.007791666666667
'Calculation' worksheet
D4 (Accounting standard) - InputFile!D2 to be pasted
D8 (Balance) - InputFile!F2 to be pasted
D10 (Discount Rate) - InputFile!J2 to be pasted
Please note the mappings of the cells to copy from in the 'Input File' and then paste to in the 'Calculations' worksheet are vital to the operation
Any help would be greatly appreciated
Thanks
Nick