Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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! -- peacelittleone ------------------------------------------------------------------------ peacelittleone's Profile: http://www.excelforum.com/member.php...o&userid=20937 View this thread: http://www.excelforum.com/showthread...hreadid=490842 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Completely forgot about Mid. -- peacelittleone ------------------------------------------------------------------------ peacelittleone's Profile: http://www.excelforum.com/member.php...o&userid=20937 View this thread: http://www.excelforum.com/showthread...hreadid=490842 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Are contents of at least one cell in a group a substring of a dif | Excel Worksheet Functions | |||
Filter substring of a cell | Excel Discussion (Misc queries) | |||
space delimited files now tab delimited | Excel Discussion (Misc queries) | |||
How can I convert tab delimited files to pipe delimited? | Excel Discussion (Misc queries) | |||
chech if a cell contains a substring | Excel Programming |