hi,
pls help.
i have a main excel 2016 with a vba code in a button.
when click on btn category A,
In sheet param, colum A is date and column B is file name.. After input the date DD-MON-YY
e.g "09-Oct-18" and file name can be anything prefix with the "_09-10-2018.xlsx";in that sheet 'Param'.;;
I want to use that data entry as parameter in the code instead of opening the macros to change the date each time.;
How to do it?
pls help.
i have a main excel 2016 with a vba code in a button.
when click on btn category A,
In sheet param, colum A is date and column B is file name.. After input the date DD-MON-YY
e.g "09-Oct-18" and file name can be anything prefix with the "_09-10-2018.xlsx";in that sheet 'Param'.;;
I want to use that data entry as parameter in the code instead of opening the macros to change the date each time.;
How to do it?
Code:
If Format(Range("A" & i).Value, "d-mmm-yy") = "09-Oct-18" Then
Range("B" & i).Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(R2C1,'D:\akika\files\[CATEGORY_99_TAS_09-10-2018.xlsx]Sheet1'!R2C1:R30C2,2,FALSE)"
Range("G" & i).Select
ActiveCell.FormulaR1C1 = _
"='D:\akika\working\[consolidate.xlsx]Sheet1'!R4C3"
Else
If Format(Range("A" & i).Value, "d-mmm-yy") = "15-Oct-18" Then
Range("B" & i).Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(R2C1,'D:\akika\files\[CATEGORY_99_TAS_15-10-2018.xlsx]Sheet1'!R2C1:R30C2,2,FALSE)"
Range("G" & i).Select
ActiveCell.FormulaR1C1 = _
"='D:\akika\working\[consolidate.xlsx]Sheet1'!R4C3"
End If
End If
Last edited by a moderator: