P
peacelittleone
All -
I have a range of cells (C2:C41) that contain 1 to 50 (variant) values
separated by chr(10).
i.e.
C2 = "xyz"
C3 = "xya ghi" (or the result of "xya" & chr(10) & "ghi"
and so on
So, I have in my macro
For Each c In myRange
curr_row = c.Row
curr_col = c.Column
tempString = c.Value
i = Len(tempString) - Len(Replace(tempString, Chr(10), ""))
'i = number of occurences of Chr(10)
For j = 1 To i + 1
curr_marker = InStr(prev_marker, tempString, Chr(10))
'curr_marker = position of current Chr(10)
Cells(curr_row, curr_col + j).Value =
*tempString.Characters(prev_marker, curr_marker - 1)*
prev_marker = curr_marker
Next j
Next c
But as you will notice the tempString.characters doesn't work.
How do I get a substring of tempString starting at position =
prev_marker for a length of curr_marker - prev_marker?
TIA!
I have a range of cells (C2:C41) that contain 1 to 50 (variant) values
separated by chr(10).
i.e.
C2 = "xyz"
C3 = "xya ghi" (or the result of "xya" & chr(10) & "ghi"
and so on
So, I have in my macro
For Each c In myRange
curr_row = c.Row
curr_col = c.Column
tempString = c.Value
i = Len(tempString) - Len(Replace(tempString, Chr(10), ""))
'i = number of occurences of Chr(10)
For j = 1 To i + 1
curr_marker = InStr(prev_marker, tempString, Chr(10))
'curr_marker = position of current Chr(10)
Cells(curr_row, curr_col + j).Value =
*tempString.Characters(prev_marker, curr_marker - 1)*
prev_marker = curr_marker
Next j
Next c
But as you will notice the tempString.characters doesn't work.
How do I get a substring of tempString starting at position =
prev_marker for a length of curr_marker - prev_marker?
TIA!