Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Looking up data in a large sheet

I have two sheets of data. Sheet A will have three pieces of
information (Account Number, Ticker, Shares) and Sheet B across the
top lists accounts and below lists tickers (up to 1400).

Sheet A (example)

1000, XXX, 1
2000, YYY, 1


Sheet B (example)

1000, 1500, 2000
AAA, AAA, BBB
CCC, CCC, CCC
XXX, XXX, XXX

In column D I need to look up in Sheet B if for Account 1000 XXX is
listed below etc.

Any help will be appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Looking up data in a large sheet

On 25 jun, 21:40, " wrote:
I have two sheets of data. Sheet A will have three pieces of
information (Account Number, Ticker, Shares) and Sheet B across the
top lists accounts and below lists tickers (up to 1400).

Sheet A (example)

1000, XXX, 1
2000, YYY, 1

Sheet B (example)

1000, 1500, 2000
AAA, AAA, BBB
CCC, CCC, CCC
XXX, XXX, XXX

In column D I need to look up in Sheet B if for Account 1000 XXX is
listed below etc.

Any help will be appreciated.


Hi Gbirdsong,

You could try something like this for cell D2 on SheetA:

' =IF(ISNA(MATCH(B2;INDIRECT("SheetB!"&ADDRESS(1;MAT CH(A2;SheetB!
$1:$1;0))&":"&ADDRESS(100;MATCH(A2;SheetB!$1:$1;0) ));0));"Not
listed";"Listed")

If you would like to know in which row the ticker is listed try:

=MATCH(B2;INDIRECT("SheetB!"&ADDRESS(1;MATCH(A2;Sh eetB!
$1:$1;0))&":"&ADDRESS(100;MATCH(A2;SheetB!$1:$1;0) ));0))

But in this case if a tickercode is not listen the result will be "N/
A"

HTH,

Wouter

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Looking up data in a large sheet

A formula would be the easiest way but if you need a macro try this:

Sub Test()
Dim i As Range, iEnd As Long, iRng As Range
Dim found1 As Variant, found2 As Variant

With Sheets(1)
iEnd = .Cells(Rows.Count, 1).End(xlUp).Row
Set iRng = .Range(.Cells(1, 1), .Cells(iEnd, 1))
End With

For Each i In iRng
Set found1 = Sheets(2).Range("A1:IV1").Find( _
i.Value, LookIn:=xlValues)
If found1 Is Nothing Then
i.Offset(0, 3) = "Not Found"
Else
With Sheets(2)
ActCol = Mid$(found1.Address, 2, 1) & ":" & _
Mid$(found1.Address, 2, 1)
End With

Set found2 = Sheets(2).Range(ActCol).Find( _
i.Offset(0, 1).Value, LookIn:=xlValues)

If found2 Is Nothing Then
i.Offset(0, 3) = "Not Found"
Else
i.Offset(0, 3) = "Found"
End If
End If
Next i

End Sub

--
Dan Oakes

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
Can you copy formulas only across a large sheet, under data? Mark Excel Worksheet Functions 2 February 9th 09 04:49 PM
copy part of large WS to another sheet Aurise Excel Worksheet Functions 3 June 19th 07 04:59 PM
Sheet File To Large due to Pivot Tables? Allan P. London, CPA Excel Programming 1 October 5th 06 10:22 PM
large page number in cenetr of sheet Ollie Excel Worksheet Functions 5 August 11th 06 04:46 AM
Multi-Sheet Pivot Table Too Large Jack Excel Discussion (Misc queries) 2 March 23rd 06 03:49 PM


All times are GMT +1. The time now is 12:41 PM.

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

About Us

"It's about Microsoft Excel"