Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Interogating a string within a Macro
If I have a string called data that contains, for example, 12 characters how
can I find teh position of two charactors within it. e.g the string is : abhhsctdshhd how can I find the position of 'ct' within it ? any suggestions appreciated. brian |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Interogating a string within a Macro
On Tue, 27 Mar 2007 16:08:55 -0700, Brian Young
wrote: If I have a string called data that contains, for example, 12 characters how can I find teh position of two charactors within it. e.g the string is : abhhsctdshhd how can I find the position of 'ct' within it ? any suggestions appreciated. brian InStr Function Returns a Variant (Long) specifying the position of the first occurrence of one string within another. Syntax InStr([start, ]string1, string2[, compare]) --ron |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Interogating a string within a Macro
instr() should do it.
-- Tim Williams Palo Alto, CA "Brian Young" wrote in message ... If I have a string called data that contains, for example, 12 characters how can I find teh position of two charactors within it. e.g the string is : abhhsctdshhd how can I find the position of 'ct' within it ? any suggestions appreciated. brian |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Interogating a string within a Macro
data = "abhhsctdshhd"
MsgBox InStr(data, "ct") Regards, Greg "Brian Young" wrote: If I have a string called data that contains, for example, 12 characters how can I find teh position of two charactors within it. e.g the string is : abhhsctdshhd how can I find the position of 'ct' within it ? any suggestions appreciated. brian |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
String functions in VB macro | Excel Discussion (Misc queries) | |||
Passing string as macro parameter | Excel Programming | |||
interogating a worksheet | Excel Worksheet Functions | |||
Edit String VB Macro | Excel Programming | |||
A Macro to replace a string in a cell with a string from another cell??? | Excel Programming |