Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default is there any substring function in macro?

use INSTR() this returns a 0 if the substring doesn't exist or the number of
the letter in the string where it occurs. You could also use the LIKE method

if INSTR(text, thisbit) 0 Then
msgbox thisbit & " is in " & text
Else
msgbox thisbit & " is not in " & text
End if

if text LIKE "*" & thisbit & "*" Then
msgbox thisbit & " is in " & text
Else
msgbox thisbit & " is not in " & text
End if




"ashishprem" wrote:


Hi All,
I am new to macro. May be its a sily question but still. I have a
string "B&F OFA 12". I wanna to know whether OFA is present in the
string or not. I mean substring...
Please help me out..
Thanks n Regards,
Ashish


--
ashishprem
------------------------------------------------------------------------
ashishprem's Profile: http://www.excelforum.com/member.php...o&userid=31485
View this thread: http://www.excelforum.com/showthread...hreadid=514302


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
Can excel macro access SUBstring individual 'char' level? If so how? bxc2739 Excel Discussion (Misc queries) 1 April 25th 06 03:58 PM
can I execute and 'substring' function in Excel Larry Excel Worksheet Functions 4 January 1st 06 08:16 PM
Run formatting macro if filename has a particular substring in it stag5353 Excel Programming 3 April 28th 05 07:24 PM
MACRO TO FIND SUBSTRING OR SUBTEXT ! jay dean Excel Programming 3 November 20th 04 07:33 PM
subString function in Excel(Urgent) Varinder Excel Programming 2 October 1st 03 10:37 AM


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