Adding row Macro

F

From Mike G.

Experts & Gurus:

I need a macro to add new rows and merge cells. For
example, I need to add 2 rows under each existing row and
then merge the contents in columns A, B, C, and D.

Existing spreadsheet:
A B C D E
1 aa ss dd ff
2 qq ww ee rr
3 cc vv bb nn

Desired speadsheet:
A B C D E
1 +
2 aa ss dd ff -
3 /
4 +
5 qq ww ee rr -
6 /
7 +
8 cc vv bb nn -
9 /

Then, I need to add the same information repeatatively in
column E.

Your help is appreciated!
Best regards, Mike
mailto:[email protected]
 
D

Don Guillett

Sub insert10rows()'change 3 to your rows.
I don't help in creating "merged cells"

For i = 3 To 2 Step -1
Cells(i, "a").Resize(2, 1).EntireRow.Insert
Next i
End Sub
 
G

Guest

Here is what you asked for: I Left the Displayalerts commented out because i want you to see what it is your "Really" asking for
Sub AddTwoRws(
x = Cells(Rows.Count, "A").End(xlUp).Ro
x = x *
For y = 2 To x Step
Rows(y).EntireRow.Inser
Rows(y).EntireRow.Inser
Nex
Rows(1).EntireRow.Inser
'Application.DisplayAlerts = Fals
Columns("A:D").Merg
'Application.DisplayAlerts = Tru
End Su


----- From Mike G. wrote: ----

Experts & Gurus

I need a macro to add new rows and merge cells. For
example, I need to add 2 rows under each existing row and
then merge the contents in columns A, B, C, and D

Existing spreadsheet
A B C D
1 aa ss dd f
2 qq ww ee r
3 cc vv bb n

Desired speadsheet
A B C D
1
2 aa ss dd ff
3
4
5 qq ww ee rr
6
7
8 cc vv bb nn
9

Then, I need to add the same information repeatatively in
column E

Your help is appreciated
Best regards, Mik
mailto:[email protected]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top