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 / December 2007

Tip: Looking for answers? Try searching our database.

vlookup ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lee willis - 15 Dec 2007 20:42 GMT
I need to know how to do a vlookup and then pull all the data under it in the
field that is the same as the lookup.  ie i am looking up ford and in the
lookup range there is more than 1 ford in a row? so lookup range is
sheet1a2:ac1040. ford is in cells a407 thur a597.  i need to pull a407 thur
ac407 in row 1 of sheet2 i know the formula for that what i am having a hard
time with is row2 of sheet 2 needs to be filled with a408 thur ac408.  can
some one help me with this?
Joel - 15 Dec 2007 21:13 GMT
Your description isn't very clear.  The code below "may" work, but if not use
it as a model or be a little clearer what you are looking for.

Sub findford()
Set Lookuprange = Sheets("Sheet1").Range("a2:a1040")

Sh2RowCount = 1
For Each cell In Lookuprange
  If cell = "ford" Then
     With Sheets("Sheet1")
        .Range(.Cells(cell.Row, "A"), _
               .Cells(cell.Row, "AC")).Copy _
        Destination:= _
           Sheets("Sheet2").Cells(Sh2RowCount, "A")
        Sh2RowCount = Sh2RowCount + 1
     End With
  End If
Next cell

End Sub

> I need to know how to do a vlookup and then pull all the data under it in the
> field that is the same as the lookup.  ie i am looking up ford and in the
[quoted text clipped - 3 lines]
> time with is row2 of sheet 2 needs to be filled with a408 thur ac408.  can
> some one help me with this?
 
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.