Hi everyone,
I have strings that are concatenated with ~ characters. an example of the format of the sorts of strings im working with is here:
(total rows,workbook name,worksheet name,column, top row, bottom row, row 1 data, row 2 data, ... , row total rows-1 data)
myString = "14~ThisWorkbook.Name~Sheets(1).Name~E~11~25~data0~data1~data2~data3~data4~data5~data6~data7~data8~data9~data10~data11~data12~data13"
I have kindly been provided with the following code by AlphaFrog which allows me to search this string for a given term and it will count the number of ~ characters to the left of the term.
code provided by AlphaFrog
'CharCount = the number of ~ characters to the left of term_to_find within the string myString
CharCount = InStr(1, myString, term_to_find, 1) - InStr(1, Replace(myString, "~", ""), term_to_find, 1)
How could I look at this string and count the number of times my term appears only it at certain positions (that is with a certain number of ~ characters to its left).
The possible positions the term can appear should be restricted to index number 6,13,20,27,..
by index number i mean the number of ~ characters in front of the term in myString
so from the above example
myString index(0) = 14
myString.index(1) = ThisWorkbook.Name
myString.index(2) = Sheets(1).Name
Etc
The index values to search for should be restricted to those mentioned above.. .. 6,13,20,27,..
Kind Regards
Jordan
Bookmarks