Hi all,
Wonder if someone may be able to help me a little. Put simply i am writting a series of macro operations that copy data from one sheet to another.
The code looks something like:
Sheets("Mm Unders & Overs by Div").Select
Range("E67:E71").Copy
Sheets("Corp Month on Month Summary").Select
Range("L17").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
But i want Cell L17 to change based on the date i have in another cell.
The way i thought of doing this is how i would do it if it was a simple formula i.e.
Created a reference area called 'sumdates' which has the date in column one and the corresponding column letter in the second column i.e.
col1 - col2
P1 Wk1 - L
P1 WK2 - N
P1 Wk3 - P
Assuming the cell containing the date is just called 'date' my formula would therefore be (bearing in mind that the 17 i.e row number never changes):
=indirect(vlookup(date,sumdates,2,0)&"17")
which would simply replace the "L17".
Trouble is i don't know where to start in making this a macro function, or if it can be done.
Any advice on the matter would be very much appreciated.
Thank you kindly in advance.
Wonder if someone may be able to help me a little. Put simply i am writting a series of macro operations that copy data from one sheet to another.
The code looks something like:
Sheets("Mm Unders & Overs by Div").Select
Range("E67:E71").Copy
Sheets("Corp Month on Month Summary").Select
Range("L17").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
But i want Cell L17 to change based on the date i have in another cell.
The way i thought of doing this is how i would do it if it was a simple formula i.e.
Created a reference area called 'sumdates' which has the date in column one and the corresponding column letter in the second column i.e.
col1 - col2
P1 Wk1 - L
P1 WK2 - N
P1 Wk3 - P
Assuming the cell containing the date is just called 'date' my formula would therefore be (bearing in mind that the 17 i.e row number never changes):
=indirect(vlookup(date,sumdates,2,0)&"17")
which would simply replace the "L17".
Trouble is i don't know where to start in making this a macro function, or if it can be done.
Any advice on the matter would be very much appreciated.
Thank you kindly in advance.