Hi All,
i have written a code that looks quite repetitive and could probably be structured much easier with a loop / case, however i'm struggling to apply a proper form. I've highlighted the only difference in bold.
Could you kindly have a look at my code below (it's an extract, the code repeats more often) and let me know if it can be arranged more efficiently, or guide me towards the correct approach?
What it does is basically copy a few rows as per the variables from one Worksheet to another Worksheet into the specified Tabs. My question is purely about the "Coding Efficiency" rather than the task itself, as it works just fine
Thanks so much in advance!
Cheers, ExcelFabs
Code:
i have written a code that looks quite repetitive and could probably be structured much easier with a loop / case, however i'm struggling to apply a proper form. I've highlighted the only difference in bold.
Could you kindly have a look at my code below (it's an extract, the code repeats more often) and let me know if it can be arranged more efficiently, or guide me towards the correct approach?
What it does is basically copy a few rows as per the variables from one Worksheet to another Worksheet into the specified Tabs. My question is purely about the "Coding Efficiency" rather than the task itself, as it works just fine
Thanks so much in advance!
Cheers, ExcelFabs
Code:
Code:
'EUR Receivables
Windows("A Forecasting.xlsm").Activate
Sheets("[B]Rec EUR fcst[/B]").Select
Range(Cells(fRow, "I"), Cells(tRow, "I")).Select
Selection.Copy
Windows("B Forecasting.xlsb").Activate
Sheets("OP_EAI_EUR").Select
Cells([B]12[/B], fcFRange).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
'EUR Payables
Windows("A Forecasting.xlsm").Activate
Sheets("[B]Pay EUR fcst[/B]").Select
Range(Cells(fRow, "I"), Cells(tRow, "I")).Select
Selection.Copy
Windows("B Forecasting.xlsb").Activate
Sheets("OP_EAI_EUR").Select
Cells([B]22[/B], fcFRange).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True