Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ashishprem,
Look at the Instr function in VBA help. If InStr(1, sStr, sStr2, vbTextCompare) 0 Then _ MsgBox "Substring " & sStr2 & " found in " & sStr --- Regards, Norman "ashishprem" wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can excel macro access SUBstring individual 'char' level? If so how? | Excel Discussion (Misc queries) | |||
can I execute and 'substring' function in Excel | Excel Worksheet Functions | |||
Run formatting macro if filename has a particular substring in it | Excel Programming | |||
MACRO TO FIND SUBSTRING OR SUBTEXT ! | Excel Programming | |||
subString function in Excel(Urgent) | Excel Programming |