Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Adding row Macro

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Adding row Macro

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



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
Adding a new row with a macro Dobbs734 Excel Discussion (Misc queries) 2 June 1st 09 06:08 PM
Adding to a Macro Steven Excel Discussion (Misc queries) 2 December 15th 08 06:21 PM
Adding a Tab in a Macro [email protected] Excel Discussion (Misc queries) 10 February 28th 06 09:57 PM
Adding Row to this macro Nigel Excel Discussion (Misc queries) 2 May 4th 05 05:27 PM
Adding a macro to a button. pauluk[_41_] Excel Programming 5 April 20th 04 02:38 PM


All times are GMT +1. The time now is 05:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"