Link to home
Start Free TrialLog in
Avatar of Seamus2626
Seamus2626Flag for Ireland

asked on

Drop in and fill formula

Hi,

I have two pieces of formula that need to dropped into cells N2, O2 and filled down to how many rows our present in the sheet (count determined by Col A)

So if there are 2500 rows of data, the formula needs to fill (N2:O2500)

The formula in N  =VLOOKUP(K2,LOOKUP,7,0)
The formula in O  =VLOOKUP(K2,LOOKUP,4,0)

Many thanks
Seamus
Avatar of Phillip Burton
Phillip Burton

and what's the problem?
Avatar of Seamus2626

ASKER

Hi Phillip,

I need vb code to auto fill "N" & "O" formula based on the count of rows in Column A

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Phillip Burton
Phillip Burton

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
With Sheets("Data")
    R = .Range("A" & Rows.Count).End(xlUp).Row
   
    .Range("N1").Value = "KAM FLAG"
    .Range("O1").Value = "KAM GAM FLAG"
    .Range("N2").Formula = "=VLOOKUP(K2,LOOKUP,7,0)"
    .Range("O2").Formula = "=VLOOKUP(K2,LOOKUP,4,0)"
   
 

    .Range("N2:O2").Copy .Range("N2:O" & R)

End With

that's what I needed Phillip!