Gasman
Enthusiastic Amateur
- Local time
- Today, 21:49
- Joined
- Sep 21, 2011
- Messages
- 16,717
[SOLVED] Construct VLOOKUP in VBA ?
Hi all,
I am trying to automate an excel sheet that I need to update each week.
I've got all the automatic input working and at present I am copying and pasting two formulae after that is carried out.
The formulae are for example row 416
=IF(ISNA(VLOOKUP($D416,Brady!$A:$K,9,FALSE)),0,VLOOKUP($D416,Brady!$A:$K,9,FALSE))
=IF(ISNA(VLOOKUP($D416,Brady!$A:$K,9,FALSE)),"NA","")
I already have one formula that is entered in another set of cells in a column to determine the data to extract.
That is =YEAR(A416)& TEXT(WEEKNUM(A416),"00") and is constructed from the code below
How would I construct the string for the first two formulae please.?
The row number is obviously changing and I wish to see the formula in the cells when looking at the sheet and not the values of the formulae. Basically just automate what I am doing manually at present.
TIA
Hi all,
I am trying to automate an excel sheet that I need to update each week.
I've got all the automatic input working and at present I am copying and pasting two formulae after that is carried out.
The formulae are for example row 416
=IF(ISNA(VLOOKUP($D416,Brady!$A:$K,9,FALSE)),0,VLOOKUP($D416,Brady!$A:$K,9,FALSE))
=IF(ISNA(VLOOKUP($D416,Brady!$A:$K,9,FALSE)),"NA","")
I already have one formula that is entered in another set of cells in a column to determine the data to extract.
That is =YEAR(A416)& TEXT(WEEKNUM(A416),"00") and is constructed from the code below
Code:
strFormula = "=YEAR(RC[-6])& TEXT(WEEKNUM(RC[-6])," & """00""" & ")"
How would I construct the string for the first two formulae please.?
The row number is obviously changing and I wish to see the formula in the cells when looking at the sheet and not the values of the formulae. Basically just automate what I am doing manually at present.
TIA
Last edited: