Vlookup array problem

G

Guest

Hi
All

My formula is like this:
Sub Create()
Range("C3:N3").Value = Application.WorksheetFunction.Vlookup(Range("A3"),
Range("450:600"), {7,10,13,16,19,22,25,28,31,34,37,40}, FALSE)
End Sub

Error which I get Is Unable to get worksheet vlookup property value...

I want to display values in cell from c3:N3 after it performs vlookup.

I have hundreds of rows.

Any help in highly appreciated.

Thanx in advance
 
T

Tom Ogilvy

VBA doesn't support array formulas which is what you are trying to do.
Sub Create()
varr = Evaluate("{7,10,13,16,19,22,25,28,31,34,37,40}")
i = lbound(varr)
for each cell in Range("C3:N3")
cell.Value = Application.WorksheetFunction.Vlookup(Range("A3"), _
Range("450:600"), varr(i), FALSE)
i = i + 1
Next
End Sub
 

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