#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default vlookup ?

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default vlookup ?

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


"lee willis" wrote:

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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
If (Vlookup 0) working, but what if Vlookup cell does not exist Steve Excel Worksheet Functions 18 November 18th 09 07:33 PM
VLookUp - Does the VLookUp return the exact information? Cpviv Excel Worksheet Functions 2 October 28th 08 09:57 AM
using a vlookup to enter text into rows beneath the vlookup cell Roger on Excel Excel Programming 1 November 29th 07 12:09 PM
Combine VLOOKUP and IF function so #NA isn't returned as a value from VLOOKUP buffgirl71 Excel Discussion (Misc queries) 12 November 14th 06 11:36 PM
Vlookup -=VLOOKUP(F9,LookUp1!$A$2:$B$1504,2,FALSE) MikeR-Oz New Users to Excel 1 March 22nd 06 09:01 AM


All times are GMT +1. The time now is 01:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"