Intersect Formula VBA Help

S

scrabtree

I need help with a VBA Intersect Formula. I have
locations identified going across the top of my
spreadsheet and then locations identified going down the
side of my spreadsheet. At the appropriate row/column
intersect cell the distance between the two locations is
identified.

I am going to have a userform pop-up and the staff can,
using a combo box, select the to and from location. I
need a formula that will look accross for the from
location and down the side for the to location and then
give me the intersect value????

SDC
 
T

Tom Ogilvy

In the worksheet you would do

=Offset(A1,Match(to,A1:A200,0),Match(from,A1:AC1))

You can use the same formulas in VBA

With Application
miles =
..Offset(Range("A1"),.Match(to,Range("A1:A200"),0),.Match(From,Range("A1:AC1"
),0))
End With

where from and to represent string variables containing locations that
match one of your column and row entries.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top