I think this should be easy for someone. I am trying to insert a simple Vlookup function using VBA. For the range I've defined, I am receiving a 1004 error. Below is the image and the script:
1 Range("M2:U" & endrow).Select
2 Set formRng = Selection
3
4 Range("formRng").Formula = "=VLOOKUP($H2,'Entity Property Sheet'!$E:$N,COLUMN()-11,0)"
5
End Sub
The error occurs on line 4, and I am not sure why. For the sake of saving lines, I didn't include the defined dimensions
ERROR HERE>>>>>>>> Range("formRng").Formula = "=VLOOKUP($H2,'Entity Property Sheet'!$E:$N,COLUMN()-11,0)"
1 Range("M2:U" & endrow).Select
2 Set formRng = Selection
3
4 Range("formRng").Formula = "=VLOOKUP($H2,'Entity Property Sheet'!$E:$N,COLUMN()-11,0)"
5
End Sub
The error occurs on line 4, and I am not sure why. For the sake of saving lines, I didn't include the defined dimensions
ERROR HERE>>>>>>>> Range("formRng").Formula = "=VLOOKUP($H2,'Entity Property Sheet'!$E:$N,COLUMN()-11,0)"