LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro that splits content from cell if given character is found


I give my example :

Column A : book titles
Column B : authors ( a book may have 1 or more authors which are
separated by a comma - like this : *John Doe , Michael Moore*

Column C , D ,E etc ... information regarding the titles which makes no
difference

The macro should read every cell in B column . If no comma is found
means it is only one author . Macro should copy the content from that
cell ( B1 ... Bn) to H column ( H1 ... Hn )

If 1 comma or more are found , means there are more authors . 1 comma
means there are 2 authors , 2 commas means there are 3 authors ... so on


Say there are 2 commas . The Macro should create 2 rows after the row
analysed with same content . More than that , should put in
corresponding H column the authors one by one . Example


A1: The fugitive B1 : John Doe , Michael Moore , Sasha Wild

The macro should to this :

A1: The fugitive B1 : John Doe , Michael Moore , Sasha Wild H1 :
John Doe
A2: The fugitive B2 : Jonh Doe , Michael Moore , Sasha Wild H2 :
Michael Moore
A3: The fugitive B3 : Jonh Doe , Michael Moore , Sasha Wild H3 :
Sasha Wild


The row number 2 ( A2 , B2 ... ) becomes row number 4 ( A4, B4 ...)
after macro does his job . Of course , it is also analysed by macro and
so on till macro find rows without text where it stops

Can this be done ?


--
andrei
------------------------------------------------------------------------
andrei's Profile: http://www.thecodecage.com/forumz/me...hp?userid=1056
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=147695

 
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
Macro that splits content from cell if given character is found andrei Excel Programming 4 September 29th 09 01:23 PM
Macro which searches for a character . When found delets what's be andrei Excel Programming 4 September 28th 09 06:09 PM
Find and replace a character in a cell with another cell's content JABAgdl Excel Programming 1 September 23rd 09 02:34 AM
checking the content of a cell if it starts with certain character Timur Excel Programming 2 August 1st 07 01:26 PM
split cell content without using a specific character/sign Donald Lloyd Excel Programming 0 July 31st 03 11:10 PM


All times are GMT +1. The time now is 09:38 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"