vasim
Member
Hello,
I have a few set of sheets; I want a match formula in cell F1 where the lookup array could be in any sheet. Attached is something which I tried to do but vain.
I tried to set x as a range and then take that range in between the match formula.
Any help appreciated.
Sub step()
Dim ws As Worksheet
Dim x As Range
For Each ws In Worksheets
If ws.Name = Range("B1").Value Then ws.Select
Next
Set x = ActiveSheet.Range("A:A")
Sheets("Sheet1").Select
'With ActiveSheet
Range("F1").Select
ActiveCell.FormulaR1C1 = "=MATCH(RC[-5],x!C[-5])"
End Sub
Regards,
Indian
I have a few set of sheets; I want a match formula in cell F1 where the lookup array could be in any sheet. Attached is something which I tried to do but vain.
I tried to set x as a range and then take that range in between the match formula.
Any help appreciated.
Sub step()
Dim ws As Worksheet
Dim x As Range
For Each ws In Worksheets
If ws.Name = Range("B1").Value Then ws.Select
Next
Set x = ActiveSheet.Range("A:A")
Sheets("Sheet1").Select
'With ActiveSheet
Range("F1").Select
ActiveCell.FormulaR1C1 = "=MATCH(RC[-5],x!C[-5])"
End Sub
Regards,
Indian