Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Substring of a Chr(10) delimited cell


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Substring of a Chr(10) delimited cell


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Are contents of at least one cell in a group a substring of a dif Paul Excel Worksheet Functions 3 February 5th 09 01:11 AM
Filter substring of a cell GregNga Excel Discussion (Misc queries) 1 December 22nd 08 10:32 PM
space delimited files now tab delimited Sunny Scripter Excel Discussion (Misc queries) 0 March 31st 08 12:39 AM
How can I convert tab delimited files to pipe delimited? Jeremy Town Excel Discussion (Misc queries) 2 November 15th 07 04:29 PM
chech if a cell contains a substring Vik[_3_] Excel Programming 8 July 31st 05 08:59 PM


All times are GMT +1. The time now is 01:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"