Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Problems with .find code

Hi,

I have code to look for the word TOTAL in a sheet

set rng = .find(What:="TOTAL")

however this finds cells that have total included anywhere in the
cell
eg Total Order
VAT Total

etc etc

I only want to find cells that the contents = TOTAL and I cannot
figure out a way to do this.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Problems with .find code

Record a macro when you change all the settings you want. Click on the Options
button if you don't see all of them.

Then your recorded macro will show you all the parms you should be specifying.

keri wrote:

Hi,

I have code to look for the word TOTAL in a sheet

set rng = .find(What:="TOTAL")

however this finds cells that have total included anywhere in the
cell
eg Total Order
VAT Total

etc etc

I only want to find cells that the contents = TOTAL and I cannot
figure out a way to do this.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Problems with .find code

Thanks. In case anybody is interested (I doubt it as it was a silly
question with a simple answer) it was the xlWhole part I was missing.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Problems with .find code

Recording a macro to get the code is a very useful technique.

keri wrote:

Thanks. In case anybody is interested (I doubt it as it was a silly
question with a simple answer) it was the xlWhole part I was missing.


--

Dave Peterson
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
Code problems [email protected] Excel Programming 0 April 5th 06 10:43 PM
Problems with code tac Excel Programming 2 March 10th 06 03:12 AM
Problems using Find James W.[_2_] Excel Programming 1 January 15th 05 01:29 AM
Problems merging an excel file due to code or file problems? Cindy M -WordMVP- Excel Programming 0 September 14th 04 02:58 PM
VBA Code problems! Simon Lloyd[_463_] Excel Programming 5 May 24th 04 10:21 PM


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