Simple macro help, pleeeeeaaase?! :)

fingerstyle

New Member
Joined
Aug 28, 2017
Messages
7
Hi,

I really hope someone here can help - I just signed up here to post an urgent question. I have been using Excel for decades but never went beyond recording macros so I don't know if there is a macro that you can write to allow me to do this - to insert the number of rows that I type at the leftmost column - see below. The idea is that these are newly added items with the same item ID, and therefore need the blank rows to inherit data in the existing table. (and preferably, those newly pasted data are coloured in, say, green so that I know those are the changes that I need to review and check.

As part of my day job, I'm having to to this for a few thousand lines so this macro would come in as a time saver.

THANK YOU!!!


Current state - but want data for existing ID copied down to newly added but same IDs:

[TABLE="class: cms_table"]
<tbody>[TR]
[TD="bgcolor: #BEC0BF"]
Insert x rows
[/TD]
[TD="bgcolor: #BEC0BF"]Data ID[/TD]
[TD="bgcolor: #BEC0BF"]Data 1[/TD]
[TD="bgcolor: #BEC0BF"]Data 2[/TD]
[TD="bgcolor: #BEC0BF"]Data 3[/TD]
[TD="bgcolor: #BEC0BF"]Data 4[/TD]
[TD="bgcolor: #BEC0BF"]Data 5[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]Data ID 01[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]Data ID 02[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FFFC66"]Data ID 03[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FFFC66"]Data ID 03[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD="bgcolor: #FFFC66"]Data ID 03[/TD]
[TD]New Data 01[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD="bgcolor: #FFFC66"]Data ID 03[/TD]
[TD]New Data 02[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD="bgcolor: #FFFC66"]Data ID 03[/TD]
[TD]New Data 03[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD="bgcolor: #FFFC66"]Data ID 03[/TD]
[TD]New Data 04[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]Data ID 04[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]Data ID 05[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 08[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 09[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 10[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 11[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 12[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
</tbody>[/TABLE]



Desired end-state (green fonts are desired additions)
[TABLE="class: cms_table"]
<tbody>[TR]
[TD="bgcolor: #BEC0BF"]
Insert x rows
[/TD]
[TD="bgcolor: #BEC0BF"]Data ID[/TD]
[TD="bgcolor: #BEC0BF"]Data 1[/TD]
[TD="bgcolor: #BEC0BF"]Data 2[/TD]
[TD="bgcolor: #BEC0BF"]Data 3[/TD]
[TD="bgcolor: #BEC0BF"]Data 4[/TD]
[TD="bgcolor: #BEC0BF"]Data 5[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]Data ID 01[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]Data ID 02[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FFFC66"]Data ID 03[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FFFC66"]Data ID 03[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD="bgcolor: #FFFC66"]Data ID 03[/TD]
[TD]New Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FFFC66"]Data ID 03[/TD]
[TD]New Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD="bgcolor: #FFFC66"]Data ID 03[/TD]
[TD]New Data 02[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FFFC66"]Data ID 03[/TD]
[TD]New Data 02[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD="bgcolor: #FFFC66"]Data ID 03[/TD]
[TD]New Data 03[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FFFC66"]Data ID 03[/TD]
[TD]New Data 03[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD="bgcolor: #FFFC66"]Data ID 03[/TD]
[TD]New Data 04[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FFFC66"]Data ID 03[/TD]
[TD]New Data 04[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]Data ID 04[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]Data ID 05[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 08[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 08[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 08[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 08[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 09[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 09[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 09[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 09[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 10[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 10[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 10[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 10[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 11[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 11[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 11[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 11[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 12[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 12[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 12[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD="bgcolor: #FAE232"]Data ID 06[/TD]
[TD]New Data 12[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
[TABLE="width: 863"]
<colgroup><col span="9"><col><col></colgroup><tbody>[TR]
[TD]Insert x rows
[/TD]
[TD]Data ID[/TD]
[TD]Data 1[/TD]
[TD]Data 2[/TD]
[TD]Data 3[/TD]
[TD]Data 4[/TD]
[TD]Data 5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]Data ID 01[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]Data ID 02[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[TD][/TD]
[TD][/TD]
[TD]this is after this macro has run[/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]Data ID 03[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[TD][/TD]
[TD][/TD]
[TD]it may give you a start[/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]Data ID 03[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[TD][/TD]
[TD][/TD]
[TD]I have no time at present to debug it[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Data ID 03[/TD]
[TD]New Data 01[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD]it is meant to add the blank rows[/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD]prior to inserting the data[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Data ID 03[/TD]
[TD]New Data 02[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD] For j = 2 To 500[/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD] If Cells(j, 1) = "" Then GoTo 100[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Data ID 03[/TD]
[TD]New Data 03[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD] For k = 1 To Cells(j, 1)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD] Cells(j + k, 1).Select[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Data ID 03[/TD]
[TD]New Data 04[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD] Selection.EntireRow.Insert[/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD] Next k[/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]Data ID 04[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[TD][/TD]
[TD][/TD]
[TD]100 Next j[/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]Data ID 05[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[TD][/TD]
[TD][/TD]
[TD]End Sub[/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]Data ID 06[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]Data ID 06[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]Data ID 06[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]Data ID 06[/TD]
[TD]Data 01[/TD]
[TD]Data 02[/TD]
[TD]Data 03[/TD]
[TD]Data 04[/TD]
[TD]Data 05[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]Data ID 06[/TD]
[TD]New Data 08[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]Data ID 06[/TD]
[TD]New Data 09[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]Data ID 06[/TD]
[TD]New Data 10[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]Data ID 06[/TD]
[TD]New Data 11[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]Data ID 06[/TD]
[TD]New Data 12[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
How about
Code:
Sub InsRws()
' fingerstyle

    Dim UsdRws As Long
    Dim Ins As Long
    Dim Rws As Long
    Dim Col As Long
    
    UsdRws = Range("B" & Rows.Count).End(xlUp).Row
    
    For Rws = UsdRws To 2 Step -1
        With Range("A" & Rws)
            If .Value <> "" Then
                Ins = .Value
                .Offset(1).Resize(Ins).EntireRow.Insert
                .Offset(, 1).Resize(Ins + 1, 6).FillDown
                .Offset(1, 1).Resize(Ins, 6).Font.Color = 45341
            End If
        End With
    Next Rws
    For Col = 4 To 7
        With Columns(Col).SpecialCells(xlBlanks)
            .Font.Color = 45341
            .Formula = "=r[-1]c"
            .Value = .Value
        End With
    Next Col

End Sub
 
Upvote 0
This works! Thank you very much. It seems to throw an error to debug at the end. With my limited (none!) knowledge of VBA coding, I couldn't decipher what it was but it did the job of inserting rows beautifully so THANK YOU, Fluff!!
 
Upvote 0
What was the error & what line of code was highlighted when you hit dubug
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top