Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50142

Using Lookup in VBA

$
0
0
Hi,

I am working on a VBA Script and am trying to create a report. In this report I need to use a lookup to pull data from another workbook into my current one.

The Macro code is:

Code:

  ActiveCell.FormulaR1C1 = _
        "=VLOOKUP(RC[-6],'[5100 Projections.xlsm]Database'!R1C1:R728C7,6)"

I would like to do this in VBA Code- someone mentioned using:

Code:

Application.WorksheetFunction.CountIf
But to be honest I'm not sure how this would work and if it would fully satisfy the needs. This will be part of an overall loop which will fill out a projections column based on Column A.

Thanks for your help in advance,
Scott

Viewing all articles
Browse latest Browse all 50142

Trending Articles