Solved

Drop in and fill formula

Posted on 2015-02-17
4
64 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

729 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