I'm struggling to convert this worksheet formula into Vba code.
=INDEX(A2:A15,MATCH(1,("X"=D2:D10)*("Y"=C2:C10),0))
The Vba error sound has beaten my eardrums and i need backup
Thanks
I'm struggling to convert this worksheet formula into Vba code.
=INDEX(A2:A15,MATCH(1,("X"=D2:D10)*("Y"=C2:C10),0))
The Vba error sound has beaten my eardrums and i need backup
Thanks
That's an array formula so you would need something like:
![]()
Please Login or Register to view this content.
or:
![]()
Please Login or Register to view this content.
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
Ah Ok Ill try this,
Thanks
The problem im having is that X and Y are variables and as i am unfamiliar with arrayformula's in vba im
having more syntax issues
dim i as string, j as string
i = "X"
j = "Y"
Selection.FormulaArray = _
"=INDEX(A2:A15,MATCH(1,(j=D2:D10)*(i=C2:C10),0))"
How can i get the above working
Thanks,
Ooh i think i worked it out
i need to break up the quotes with the & symbol and bring in the variables that way.
Think i'm sorted
I reckon
![]()
Please Login or Register to view this content.
Josie
if at first you don't succeed try doing it the way your wife told you to
Untested, but I think you'd get away with:
![]()
Please Login or Register to view this content.
Regards, TMS
you need the quotes in the formula unless those are named ranges
@JP: there was going to be a long answer but I think you're probably right.![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks