Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default find a string in one cells

I want to find a special string like "Total" in some cells.

I tried to use find which is a methed of range, but it works only with value
and match which only works in the spreadsheet, but not VBA coding.


Are there any function that can find a sub string of the cell?

Your help is great appreciated,


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default find a string in one cells

From the help file for the Find method...
"expression.Find(What, After, LookIn, LookAt, SearchOrder, SearchDirection, MatchCase, MatchByte)"

For the "LookAt" argument specify "xlPart"
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"Souris"
wrote in message
I want to find a special string like "Total" in some cells.

I tried to use find which is a methed of range, but it works only with value
and match which only works in the spreadsheet, but not VBA coding.

Are there any function that can find a sub string of the cell?
Your help is great appreciated,


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default find a string in one cells

Sheets("sheet1").Cells(7, 1).Find(MyString, , , xlPart)

I got type mismatch using abover code,

Thanks again,

"Jim Cone" wrote:

From the help file for the Find method...
"expression.Find(What, After, LookIn, LookAt, SearchOrder, SearchDirection, MatchCase, MatchByte)"

For the "LookAt" argument specify "xlPart"
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"Souris"
wrote in message
I want to find a special string like "Total" in some cells.

I tried to use find which is a methed of range, but it works only with value
and match which only works in the spreadsheet, but not VBA coding.

Are there any function that can find a sub string of the cell?
Your help is great appreciated,



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default find a string in one cells

Hi,
Instr( cells(1,1).value, "searchstring" )
rgds,
Lazzzx

"Souris" skrev i meddelelsen
...
I want to find a special string like "Total" in some cells.

I tried to use find which is a methed of range, but it works only with
value
and match which only works in the spreadsheet, but not VBA coding.


Are there any function that can find a sub string of the cell?

Your help is great appreciated,



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default find a string in one cells


Dim rngFound As Range
Set rngFound = Sheets("sheet1").Cells.Find(MyString, , , xlPart)
-or-
If you know the cell to look in use the code that Lazzzx provided.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins - check out "Find and List")



"Souris"
wrote in message
Sheets("sheet1").Cells(7, 1).Find(MyString, , , xlPart)

I got type mismatch using abover code,

Thanks again,

"Jim Cone" wrote:

From the help file for the Find method...
"expression.Find(What, After, LookIn, LookAt, SearchOrder, SearchDirection, MatchCase, MatchByte)"

For the "LookAt" argument specify "xlPart"
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"Souris"
wrote in message
I want to find a special string like "Total" in some cells.

I tried to use find which is a methed of range, but it works only with value
and match which only works in the spreadsheet, but not VBA coding.

Are there any function that can find a sub string of the cell?
Your help is great appreciated,



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 specific string in range of cells Ian Excel Programming 2 June 8th 07 04:25 PM
Find String in another string - only between spaces Nir Excel Worksheet Functions 9 November 2nd 06 11:31 AM
Find Many String options in ONE String Nir Excel Worksheet Functions 6 October 26th 06 07:13 AM
Need to find the right-most cell value in a string of cells -dc- Excel Worksheet Functions 2 March 8th 05 07:28 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:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"