Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Drop in and fill formula

Posted on 2015-02-17
4
Medium Priority
?
67 Views
Last Modified: 2015-02-19
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
0
Comment
Question by:Seamus2626
  • 2
  • 2
4 Comments
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40614527
and what's the problem?
0
 

Author Comment

by:Seamus2626
ID: 40614609
Hi Phillip,

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

Thanks
0
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 2000 total points
ID: 40614612
Why not create a table, and then it can be autofilled?
0
 

Author Comment

by:Seamus2626
ID: 40614758
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This article describes a serious pitfall that can happen when deleting shapes using VBA.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question