This is part of the vba code (modified recorded Macro) I currently have:
Dim strSheet1 As String, strSheet2 As String, lngRow as Long
Sheets(strSheet1).Select
lngRow = Cells(Rows.Count, "A").End(xlUp).Row
Range("J2").Select
ActiveCell.FormulaR1C1 = "=IF(ISNA(VLOOKUP(RC[-1],'SFDB'!R2C15:R[47]C15,1,FALSE)),""No"","""")"
I'm trying to:
- change the
'SFDB'!to something likestrSheet2!, but running this, excel would ask me to select another excel file (strSheet1andstrSheet2are both from InputBox) - change
R[47]toR[lngRow], but this would lead to an error "Method FormulaR1C1 of Object Range Failed"