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
Seamus2626Asked:
Who is Participating?
 
Phillip BurtonDirector, Practice Manager and Computing ConsultantCommented:
Why not create a table, and then it can be autofilled?
0
 
Phillip BurtonDirector, Practice Manager and Computing ConsultantCommented:
and what's the problem?
0
 
Seamus2626Author Commented:
Hi Phillip,

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

Thanks
0
 
Seamus2626Author Commented:
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!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.