Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Duplicate rows into new rows based on row value

If you send me the workbook I'll try to do it for you:

take out the REMOVE part...



--
RyGuy


"Tom" wrote:

Hi Ryan,
However I'm still having some difficulty. The are being broken out and
increasing by the number in column a however it doesn't consider the original
column in the macro so is a row is supposed to be broken out for a total of
two rows I get a total of three. Can this be adjusted? Please advise.
Thanks and best regards!


"ryguy7272" wrote:

Assuming:
Col A has numbers (such as 2 and 3) and Col B has data beginning with the
letters (such as ABC...)
A B
2 ABC 5.5
3 DEF 2.3

I think this will pretty much do what you want; you may have to modify it a
tad:
Sub InsertAnyRows()

Dim insertNumber As Range
Dim insertStart As Range
Dim redRng As Range
Dim i As Integer

Set insertNumber = Application.InputBox _
(Prompt:="Select a point to begin inserting rows. For instance, choose first
non blank cell in Column A", Title:="Add a row", Type:=8)
insertNumber.Select
If insertNumber <= 0 Then
MsgBox ("Invalid Number Entered")
Exit Sub
End If
Dim myRow As Long

lastcell = Cells(Rows.Count, "A").End(xlUp).Row
myRow = 1
Do Until myRow = lastcell
For i = 1 To Cells(myRow, 1)

If Cells(myRow, 1) < "" Then
Cells(myRow + 1, 1).Select
Selection.EntireRow.Insert Shift:=xlDown
End If

Next
lastcell = Cells(Rows.Count, "A").End(xlUp).Row
myRow = myRow + 1
Loop


Range("a2").Select
Range(Selection, Selection.End(xlDown)).Select
Range("a2:B100").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.FormulaR1C1 = "=R[-1]C"



End Sub


Regards,
Ryan--


--
RyGuy


"Wehrmacher" wrote:

I am not sure I understand the question. It looks like the example is a
sorting of a long list of rows that contain similar identical data in some
fields. If this is what you are looking for, you can look in the Data menu,
select Sort and chose the column priorities and orders you wish.

You may also want to take a look at Pivot Tables. These things organize your
data according to the content of row and column information. I doubt this is
what you are talking about as pivot tables are used to compress data and your
question seems to talk about expanding it.

Hope this helps.
--
Bill Wehrmacher


"Tom" wrote:

Hi,
I am trying to breakout multiple rows into individual rows based on a value
in the row.... sounds confusing. Here's an example
a b c etc....
1 2 ABC 5.5
2 3 DEF 2.3

I need to break this out into individual rows like this...

a b c
1 2 ABC 5.5
2 2 ABC 5.5
3 3 DEF 2.3
4 3 DEF 2.3
5 3 DEF 2.3

Is this possible using a function or macro? Please let me know.

Thanks in advance!


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
Insert new rows based on Data in other rows mg_sv_r Excel Worksheet Functions 5 November 21st 07 01:51 PM
Hiding Specific Rows Based on Values in Other Rows Chris Excel Worksheet Functions 1 November 2nd 06 08:21 PM
Remove duplicate rows based on 1 specific criterion Sweepea Excel Discussion (Misc queries) 5 August 30th 06 04:28 PM
Insert duplicate rows based on numeric value in column Nu2Excel Excel Discussion (Misc queries) 2 September 24th 05 04:31 PM
Duplicate Rows instauratio Excel Discussion (Misc queries) 1 June 6th 05 08:36 PM


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