LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default How to Find Data in another Worksheet without activating it?

I am attempting to create a "config" spreadsheet where parameters for
another spreadsheet can be looked up. I can do this easily if I
activate the other worksheet. And, I can refer directly to the other
worksheet's cells without activating them if I already know the
coordinates of the cell to look at.

But I can't for example, search for a word in column 1 of another
worksheet and then get the value of the 5th column over where that
value was found, unless I activate the other worksheet first.

For example, imagine there is a combo box on the first worksheet with
"Big", "Medium", and "Small". And various calculations are to be done
on the first worksheet based on the user's choice. Then, on a second
worksheet called "config", there are columns of data indicating the
height and width of "Big", "medium", or "small".

I want to have formulas reference that config data without activating
the worksheet. My thought was to do a find for whatever the user
selected, and then go over to the other columns to pull the data
needed. Here's how it works with activating the sheet:
Dim iHeight As Integer
Dim sSize As String
sSize = Worksheets("Plan").Cells(1, 5).Value
Worksheets("Config").Activate
iHeight = Cells(Cells.Find(What:= sSize, _
After:=Cells(1, 1), LookIn:=xlFormulas, LookAt:=xlPart, _
SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=
_
False, SearchFormat:=False).Row, 7).Value

Here's how I hoped it would work, but it didn't:
Dim iHeight As Integer
Dim sSize As String
sSize = Worksheets("Plan").Cells(1, 5).Value
iHeight = Worksheets("Config").Cells(Cells.Find(What:= sSize, _
After:=Cells(1, 1), LookIn:=xlFormulas, LookAt:=xlPart, _
SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=
_
False, SearchFormat:=False).Row, 7).Value

Or, this (which didn't work either):
Dim iHeight As Integer
Dim sSize As String
sSize = Worksheets("Plan").Cells(1, 5).Value
iHeight = Cells(Cells.Find(What:= sSize, _
After:=Worksheets("Config").Cells(1, 1), LookIn:=xlFormulas,
LookAt:=xlPart, _
SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=
_
False, SearchFormat:=False).Row, 7).Value

In both cases where it didn't work, the failure only occurred if the
function was triggered from another worksheet. Unfortunately, it needs
to work from other worksheets.

Thanks in advance for any help.
 
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
Finding Worksheet and Activating it Rob Excel Discussion (Misc queries) 2 January 30th 07 08:14 PM
Activating a Worksheet? Kenny R Excel Discussion (Misc queries) 3 December 8th 06 05:15 PM
find hidden data in worksheet catlover1946 Excel Worksheet Functions 19 July 20th 06 03:33 AM
Activating a worksheet through use of a variable Cads Excel Worksheet Functions 2 February 7th 06 10:45 AM
Find repeat data in a worksheet J1 Excel Discussion (Misc queries) 1 November 2nd 05 11:08 PM


All times are GMT +1. The time now is 12:16 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"