LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Create rows from existing rows


try this code

Sub seperate_semicolon()

LastRow = Cells(Rows.Count, "A").End(xlUp).Row
RowCount = 1
Do While Range("A" & RowCount) < ""
SemiColonStr = Trim(Range("B" & RowCount))
Do While Len(SemiColonStr) 0
If InStr(SemiColonStr, ";") 0 Then
Number = Left(SemiColonStr, InStr(SemiColonStr, ";") - 1)
SemiColonStr = Mid(SemiColonStr, InStr(SemiColonStr, ";") + 1)
Rows(RowCount + 1).Insert
Range("B" & RowCount) = Number
Range("A" & RowCount + 1) = Range("A" & RowCount)
Range("C" & RowCount + 1) = Range("C" & RowCount)
RowCount = RowCount + 1
Else
Number = SemiColonStr
Range("B" & RowCount) = Number
SemiColonStr = ""
End If
Loop

RowCount = RowCount + 1
Loop

End Sub

"Joe K." wrote:


I have a spreadsheet in the format listed below. I would like to
spreadsheet each number separated by semi colons into a new records.

Please help me with excel VBA code to complete this task.

Thanks,


Column A Column B Column C
Colorado 1;4;6;11;25 Denver
Florida 24;38;44;12 Miami
Illinois 13;7;8;9;10 Chicago


Desire Output
Column A Column B Column C
Colorado 1 Denver
Colorado 4 Denver
Colorado 6 Denver
Colorado 11 Denver
Colorado 25 Denver
Florida 24 Miami
Florida 38 Miami
Florida 44 Miami
Florida 12 Miami
Illinois 13 Chicago
Illinois 7 Chicago
Illinois 8 Chicago
Illinois 9 Chicago
Illinois 10 Chicago

 
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
How do I add many rows in between existing rows in spreadsheet? MarshaMarsha Excel Worksheet Functions 1 March 27th 08 07:17 AM
New rows overwriting existing problem Carlee Excel Programming 1 July 8th 07 02:45 AM
How to find the rows existing in one column but not the other? Fred[_26_] Excel Programming 1 October 12th 05 09:45 PM
Insert Rows between the existing rows Pradeep Patel Excel Discussion (Misc queries) 4 October 8th 05 07:43 PM
inserting a row between two existing rows Jennie New Users to Excel 6 January 8th 05 01:48 PM


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