Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Find Function

All right i have a problem.

Say I have a column with cells of:
D
B,DA
F,AD
D,AD

Currently the code below finds all the values of anything with the
letter "D" in it. I only want it to find values where it is just "D".

so finding cell with D,AD is fine because it has D in it.

But finding cell with F,AD is not fine. Which it currently finds
because it has a "D" in the part of "AD"

Any ideas? I was thinking about parse each cell but i think that would
take too long and be lengthy.

Set rngFound = rngToSearch.Find(What:=("D"), _
LookIn:=xlValues, _
LookAt:=xlPart, _
MatchCase:=True)

Any Ideas?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default Find Function

Change xlPart to xlWhole.

Hope this helps,

Hutch

"RigasMinho" wrote:

All right i have a problem.

Say I have a column with cells of:
D
B,DA
F,AD
D,AD

Currently the code below finds all the values of anything with the
letter "D" in it. I only want it to find values where it is just "D".

so finding cell with D,AD is fine because it has D in it.

But finding cell with F,AD is not fine. Which it currently finds
because it has a "D" in the part of "AD"

Any ideas? I was thinking about parse each cell but i think that would
take too long and be lengthy.

Set rngFound = rngToSearch.Find(What:=("D"), _
LookIn:=xlValues, _
LookAt:=xlPart, _
MatchCase:=True)

Any Ideas?


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
#VALUE about function Find hui Excel Worksheet Functions 14 September 12th 06 04:01 PM
Find function alamo Excel Worksheet Functions 1 September 16th 05 02:01 PM
Find Function Steve Excel Worksheet Functions 2 May 11th 05 07:56 PM
Find Function via VB John Excel Programming 1 June 6th 04 04:01 PM
backwards find function to find character in a string of text Ashleigh K. Excel Programming 1 January 14th 04 04:36 PM


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