Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default I need help with parsing cells ...

Data in one cell of a row may contain zero or more accounts names.

If the cell contains more than one account name, the names are sparated by a
comma

If there are more than one account names in the target cell of a row
I need to replicate that row n times where n is the number of account
names, and
place a copy of a unique account name in each row.

I need to figure out how I can:

Parse each target cell to determine how many account names I have

Copy and Insert additional rows such that there are n row where n is the
number of account names

Take the parsed string and put one account name per row in the target cell.

I think I can figure out how to insert the appropriate number of rows, but I
could use help on parsing the data in the cell in the first place.

-- Henry

--


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default I need help with parsing cells ...

roughly how many account names might there be? 5 or 500?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default I need help with parsing cells ...

Here is what I got...

Sub parsinator()
cellval = Range("A1").Value

intcounter = 1
On Error GoTo Foundallcommas
Do Until x = 100
l = Len(cellval)
locationoffirstcomma = WorksheetFunction.Search(",", cellval, 1)
temp = Left(cellval, locationoffirstcomma - 1)
cellval = Right(cellval, l - locationoffirstcomma - 1)
Cells(intcounter, 2).Value = temp
intcounter = intcounter + 1
Loop

Foundallcommas:
Cells(intcounter, 2).Value = cellval


End Sub

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
Parsing line breaks into separate cells JaneA28206 Excel Discussion (Misc queries) 3 October 27th 09 01:37 PM
Parsing Cells with embedded returns sportsguy Excel Discussion (Misc queries) 2 April 4th 06 08:17 PM
Parsing words in excel cells Acfonseca Excel Worksheet Functions 2 January 10th 05 02:02 PM
transposing and parsing cells James[_29_] Excel Programming 1 January 3rd 05 10:32 PM
Parsing data - variable length cells Karen[_11_] Excel Programming 2 January 8th 04 11:19 PM


All times are GMT +1. The time now is 09:16 AM.

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"