Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Making Find ignore parts of a sheet?

I have a spreadsheet that is initially filled with a big chunk of data
from our SQL db, pasted into the far right and then hidden. I have
formulas in columns on the left end of the sheet to refer to data in
those cells and convert them into user-readable values. Some of the
input columns contain text.

The problem is that when you use Find to look up some of these text
values, Excel gets hits in these hidden columns. When this happens,
the sheet is scrolled way over to the right, and the cursor placed
inside an invisible field. Clearly this is sub-optimal.

Is there any way to tell Excel to ignore hidden fields, or
alternately, ignore a particular range? I'd need to do this globally
in the workbook, I cannot pass this burden onto the user. Solutions
using the Format box in Find, for instance, are a non-starter.

Maury
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Making Find ignore parts of a sheet?

On Mar 6, 9:51*am, Maury Markowitz wrote:
I have a spreadsheet that is initially filled with a big chunk of data
from our SQL db, pasted into the far right and then hidden. I have
formulas in columns on the left end of the sheet to refer to data in
those cells and convert them into user-readable values. Some of the
input columns contain text.

The problem is that when you use Find to look up some of these text
values, Excel gets hits in these hidden columns. When this happens,
the sheet is scrolled way over to the right, and the cursor placed
inside an invisible field. Clearly this is sub-optimal.

Is there any way to tell Excel to ignore hidden fields, or
alternately, ignore a particular range? I'd need to do this globally
in the workbook, I cannot pass this burden onto the user. Solutions
using the Format box in Find, for instance, are a non-starter.

Maury


Maury,

You can alter this code to fit your needs, but essentially what you
want to use is .SpecialCells(xlCellTypeVisible). Below you will
notice that I'm using a generic .UsedRange to get any cell that could
potentially have data in it and then the .SpecialCells
(xlCellTypeVisible) to restrict the UsedRange to only visible cells.
These are nested in Intersect to return only the visible cells in the
UsedRange.

I hope this helps.

Matt

Sub FindInVisibleCells()
Dim rngFind As Range
Dim rngUsed As Range
Dim strFind As String

Set rngUsed = ActiveSheet.UsedRange
Set rngFind = Intersect(rngUsed, rngUsed.SpecialCells
(xlCellTypeVisible))

strFind = rngFind.Find(What:="matt").Address

End Sub
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Making Find ignore parts of a sheet?

Put the db data on a separate sheet?
--
Jim Cone
Portland, Oregon USA



"Maury Markowitz"

wrote in message
I have a spreadsheet that is initially filled with a big chunk of data
from our SQL db, pasted into the far right and then hidden. I have
formulas in columns on the left end of the sheet to refer to data in
those cells and convert them into user-readable values. Some of the
input columns contain text.

The problem is that when you use Find to look up some of these text
values, Excel gets hits in these hidden columns. When this happens,
the sheet is scrolled way over to the right, and the cursor placed
inside an invisible field. Clearly this is sub-optimal.

Is there any way to tell Excel to ignore hidden fields, or
alternately, ignore a particular range? I'd need to do this globally
in the workbook, I cannot pass this burden onto the user. Solutions
using the Format box in Find, for instance, are a non-starter.
Maury
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Making Find ignore parts of a sheet?

Ok, it turns out that if you simply select "Values" in the "search in"
popup instead of "Formulas" it ignores hidden fields. I'm sure someone
at MS thought this made sense.

So now the question is whether or not there is a switch somewhere that
I can use to select this as the default operation when the sheet is
open.

Maury
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Making Find ignore parts of a sheet?

On Mar 6, 11:18*am, Maury Markowitz wrote:
Ok, it turns out that if you simply select "Values" in the "search in"
popup instead of "Formulas" it ignores hidden fields. I'm sure someone
at MS thought this made sense.

So now the question is whether or not there is a switch somewhere that
I can use to select this as the default operation when the sheet is
open.

Maury


You may want to investigate the Find Method in the VBE help. Here is
a cut and paste from the help. "The settings for LookIn, LookAt,
SearchOrder, and MatchByte are saved each time you use this method. If
you don’t specify values for these arguments the next time you call
the method, the saved values are used. Setting these arguments changes
the settings in the Find dialog box, and changing the settings in the
Find dialog box changes the saved values that are used if you omit the
arguments. To avoid problems, set these arguments explicitly each time
you use this method."

I hope this helps in some way.

Best,

Matt Herbert
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
Building the sheet name from two parts? Nice Excel Worksheet Functions 2 March 7th 06 09:14 AM
Blank cells in named range- how to ignore them when making my graph? Help plz! KR Excel Discussion (Misc queries) 0 August 24th 05 02:35 PM
making graphs ignore "blank " cells Guillermo Excel Discussion (Misc queries) 4 February 22nd 05 09:26 PM
find parts of a total Jim Excel Worksheet Functions 1 February 22nd 05 08:07 PM
Making Excel Ignore invalid references abxy[_26_] Excel Programming 1 February 10th 04 09:57 PM


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