hi guys.
my sheet name is store in D1. if i record a macro i get the right information the formula is as follows
Code
ws.Range("d3").Formula = "=INDEX(INDIRECT(""'""&R1C&""'!""&""1:2""),2,MATCH(RC3,INDIRECT(""'""&R1C&""'!""&""1:1""),0))"
i wanted to use a different way to find it, using variables so i used the following formula which doesnt work , some syntax issue which i am not able to figure out
Code
Dim drng As Range
Dim ws as worksheet
Set ws = Worksheets("Staff")
Set drng = ws.Cells(1, 4)
ws.Range("d3").Formula = "=INDEX(INDIRECT(""'"" & drng.Address(True, False) & ""'!""&""1:2""),2,MATCH(C3,INDIRECT(""'"" & drng.Address(True, False) & ""'!""&""1:1""),0))"
i also tried to remove 1 set of speech marks from either side of & but i am stuck, any help would be greatly appreciated