Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Comparing a range with text

Hello all,

I hope someboy can help with this, I have defined a name (Text_range)
for a range of cells.
I would like to write a macro that compares all cells in the range
with a string.

The reason I want to refer to the defined name for the cells is
because the range is not continuous
(=Results!$A$16:$A$84,Results!$A$86:$A$241...etc).

Any help would be much appreciated.

Ray
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Comparing a range with text

Hi
try somthing like
sub foo()
dim rng as range
dim cell as range
set rng = Range("Text_range")
for each cell in rng
if cell.value="your_test_value" then
msgbox "Found value in cell: " cell.address
end if
next
end sub

--
Regards
Frank Kabel
Frankfurt, Germany


Frood wrote:
Hello all,

I hope someboy can help with this, I have defined a name (Text_range)
for a range of cells.
I would like to write a macro that compares all cells in the range
with a string.

The reason I want to refer to the defined name for the cells is
because the range is not continuous
(=Results!$A$16:$A$84,Results!$A$86:$A$241...etc).

Any help would be much appreciated.

Ray


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
Comparing text and then adding numbers if the text matches rotor11 Excel Worksheet Functions 2 April 8th 09 08:38 PM
COMPARING TEXT IN A RANGE OF CELLS AND DISPLAY IT IN ANOTHER. John Excel Worksheet Functions 1 February 25th 09 12:35 PM
Comparing a range of values tamirh Excel Discussion (Misc queries) 3 November 7th 08 10:51 PM
Comparing One Range and Adding Another statusquo Excel Worksheet Functions 3 December 9th 05 01:54 AM
Comparing a Range of Values jpx Excel Discussion (Misc queries) 4 November 22nd 05 10:28 PM


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