P
peter
Hi,
I found this on the web
offset(indirect(address(match("H*",sheet1!$a$2:$a$1000,0)
+1,1)),0,0,countif(sheet1!$a$2:$a$1000,"H*"),1)
It works fine when entered as a named range in the ss.
When I try to use it in VBA it errors.
ActiveWorkbook.Names.Add Name:="test",
RefersToR1C1:="=OFFSET(INDIRECT(ADDRESS(MATCH(" & "h*"
& ",Sheet1!$A$2:$A$1000,0)+1,1)),0,0,COUNTIF(Sheet1!
$A$2:$A$1000," & "h*" & "),1)"
I hope it has something to do with the quotes not the use
of indirect.
I want to be able to replace the "h*" with a variable.
Any help greatly appreciated.
peter
I found this on the web
offset(indirect(address(match("H*",sheet1!$a$2:$a$1000,0)
+1,1)),0,0,countif(sheet1!$a$2:$a$1000,"H*"),1)
It works fine when entered as a named range in the ss.
When I try to use it in VBA it errors.
ActiveWorkbook.Names.Add Name:="test",
RefersToR1C1:="=OFFSET(INDIRECT(ADDRESS(MATCH(" & "h*"
& ",Sheet1!$A$2:$A$1000,0)+1,1)),0,0,COUNTIF(Sheet1!
$A$2:$A$1000," & "h*" & "),1)"
I hope it has something to do with the quotes not the use
of indirect.
I want to be able to replace the "h*" with a variable.
Any help greatly appreciated.
peter