Solved

how to drag vlookup in vba for all the cells down with dynamic range

Posted on 2011-03-10
1
236 Views
Last Modified: 2012-06-27
how to drag vlookup in vba for all the cells down
I have written

 
     Cells(4, Newcolumn).Formula = Application.WorksheetFunction.VLookup(Range("A4"), Sheets("Basic_Data").Range("C2:J7129"), 8, False)

Selection.AutoFill Destination:=Cells(newrange & ":" & r & "7129")
 Range(newrange & ":" & r & "7129").Select

but this is copying only values not formula. I need to use dynamic range
0
Comment
Question by:Ruchi_Sas
1 Comment
 
LVL 13

Accepted Solution

by:
gamarrojgq earned 125 total points
ID: 35096483
Hi,

Try it like this

Cells(4, Newcolumn).Formula = "=VLOOKUP(A4,Basic_Data!$C$2:$J$7129,8,False)"
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now