Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel - determine the range dynamically

Status
Not open for further replies.

Kevinski

Technical User
Jan 4, 2001
95
NZ
Hello

I have the following piece of code in a macro

Code:
Range("C2").Select
    ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],TLIST,2,FALSE)"
    Selection.AutoFill Destination:=Range("C2:C10")

This is fine for the 10 rows of data I used for testing but how do I repeat this function where I don't know how many rows of data I have?

In other words "perform this VLOOKUP in column 'C' for as many rows of data I have and then stop"
 
Have a look here: faq68-1331

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top