Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 788
Default Is it possible - find all of a named range?

For discussion sake, let's have three tabs in our spreadsheet:

Tab1 - complete hockey schedule (home team column A, visiting team column B)
Tab2 - column A has complete list of eastern teams and is named "EasternTeams"
Tab3 - column A has complete list of western teams and is named "WesternTeams"

Is it possible to have a find routine identify every game where a home team
is from the West?

As long as I use an individual and specific city, I can get it to work fine
ex.

Cells.Find(What:="Seattle", After:=ActiveCell, LookIn:=xlValues,
LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate

Then a little loop allows me to go through and highlight all of the Seattle
games.

Is it possible to find all instances of all Western teams (named range)? I
haven't managed to get this to work.

Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Is it possible - find all of a named range?

You will have to use some sort of loop, no matter where your data is located.
The Find function can accomodate only one value at a time. The find next
method is essentially a loop that continues to look for the same value in
additional locations.

"Chris" wrote:

For discussion sake, let's have three tabs in our spreadsheet:

Tab1 - complete hockey schedule (home team column A, visiting team column B)
Tab2 - column A has complete list of eastern teams and is named "EasternTeams"
Tab3 - column A has complete list of western teams and is named "WesternTeams"

Is it possible to have a find routine identify every game where a home team
is from the West?

As long as I use an individual and specific city, I can get it to work fine
ex.

Cells.Find(What:="Seattle", After:=ActiveCell, LookIn:=xlValues,
LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate

Then a little loop allows me to go through and highlight all of the Seattle
games.

Is it possible to find all instances of all Western teams (named range)? I
haven't managed to get this to work.

Thank you.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 788
Default Is it possible - find all of a named range?

I was afraid of that. So that's what I've done and it all works fine. I now
highlight the indidual cells. The code looks like this:

findString = Sheets("West Teams").Cells(checkRow, dataColumn).Value

While findString " "

Sheets("Hockey Schedule").Select
Range("B1").Activate

Set c = Cells.Find(What:=findString, After:=ActiveCell,
LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False)

If Not c Is Nothing Then
Cells.Find(What:=findString, After:=ActiveCell,
LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
FirstRow = ActiveCell.Row
Do
Selection.Font.Bold = True
Selection.Font.Italic = True
Cells.FindNext(After:=ActiveCell).Activate
Loop While Not Cells.Cells Is Nothing And ActiveCell.Row <
FirstRow
End If

checkRow = checkRow + 1
findString = Sheets("West Teams").Cells(checkRow, dataColumn).Value

Wend


But is there a way to highlight the entire row?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Is it possible - find all of a named range?

Selection.EntireRow.Font.Bold = True

Mike F
"Chris" wrote in message
...
I was afraid of that. So that's what I've done and it all works fine. I now
highlight the indidual cells. The code looks like this:

findString = Sheets("West Teams").Cells(checkRow, dataColumn).Value

While findString " "

Sheets("Hockey Schedule").Select
Range("B1").Activate

Set c = Cells.Find(What:=findString, After:=ActiveCell,
LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False)

If Not c Is Nothing Then
Cells.Find(What:=findString, After:=ActiveCell,
LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
FirstRow = ActiveCell.Row
Do
Selection.Font.Bold = True
Selection.Font.Italic = True
Cells.FindNext(After:=ActiveCell).Activate
Loop While Not Cells.Cells Is Nothing And ActiveCell.Row <
FirstRow
End If

checkRow = checkRow + 1
findString = Sheets("West Teams").Cells(checkRow, dataColumn).Value

Wend


But is there a way to highlight the entire row?



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
find last used cell (row) in a named range Harold Good Excel Programming 8 February 19th 09 05:05 PM
Find Row in a named range Raul Excel Worksheet Functions 3 November 24th 07 12:41 AM
Find Cell in Named Range David Excel Worksheet Functions 3 May 8th 07 06:00 AM
find within a named range, then deselect the range Bob Mouldy Excel Programming 4 August 23rd 06 02:48 PM
How to find all formulas that used a certain named range Laurence Lombard Excel Discussion (Misc queries) 2 October 25th 05 08:15 AM


All times are GMT +1. The time now is 02:20 AM.

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"