Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / November 2007

Tip: Looking for answers? Try searching our database.

Vlookup with varing Column length

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Matadi Tappe - 24 Nov 2007 04:52 GMT
I have this code:
ActiveCell.FormulaR1C1 = _
       "=VLOOKUP(RC37,'PRICING TEMPLATE II .xls'!Cat_Code,2,0)"
Used Macro recorder and it works to an extent. I have to manually copy and
paste to the last text entry in cloumn AD.  I can not modify code to go as
far as the last occupied cell in cloumn AD and stop. Any sugestion as to the
routine to use for this. The Answer is returned to Cell A2 on down.

Thanks
Signature

Tappita

Joel - 24 Nov 2007 09:16 GMT
ActiveCell.FormulaR1C1 = _
       "=VLOOKUP(RC37,'PRICING TEMPLATE II .xls'!Cat_Code,2,0)"
LastRow = Cells(Rows.Count, 37).End(xlUp).Row

ActiveCell.Copy _
  Destination:=Range(ActiveCell, Cells(LastRow, ActiveCell.Column))

> I have this code:
> ActiveCell.FormulaR1C1 = _
[quoted text clipped - 5 lines]
>
> Thanks
Matadi Tappe - 24 Nov 2007 13:02 GMT
You are an expert. It works. Thanks Joel!
Signature

Tappita

> ActiveCell.FormulaR1C1 = _
>         "=VLOOKUP(RC37,'PRICING TEMPLATE II .xls'!Cat_Code,2,0)"
[quoted text clipped - 12 lines]
> >
> > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.