Inserting a row between two merged cell

sisi001

New Member
Joined
Jun 24, 2011
Messages
10
Hi All,
I am using macro in Office 2007.

I have a table where my first coulmn are 2 active cell with 9 cells merged in each. And I have second column which is a regular column and acts like a subcategory column for column 1.

Now I need to insert a row and paste copy data in the second column which should be under the first active merged cell in column 1.

Please can anyone help me with this. Will be really appreciated.

Thank You
Sisi001
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
You use macro Recorder. Start recorder --> You execute operations explained in previous post --> Stop recorder.
In Vb editor you'll have the code
 
Upvote 0
Re: Inserting a row between two merged cells

Any chance someone could actually have a look at this one and give a real answer, telling someone to use the macro is pretty much stating the obvious, or in this case the OBVIOUSLY NOT.:(

I use macros to sort out most of my code problems but this one even has me beat!!!!

I'm trying to do the same this I have a cell of 3 merged cells (A3:A5) and a cell of 4 merged cells (A6:A9) and I want to insert a row between them.

If you do a recording of inserting a row by selecting a cell within a merged range, the operation goes fine and you end up with a new row in the right place and a nice little script supposedly to do it again.

Rows("6:6").Select
Range("B6").Activate
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove


Now try deleting the inserted row so you are back to the beginning , and running that same script and it's a whole different result. you end up inserting the same number of rows as contained in the merged cell.

Kind Regards

Bizzytech

 
Upvote 0
Code:
Sub Isert()
Rows(6).EntireRow.Insert Shift:=xlDown
End Sub
 

Sub Delete()
Rows(6).Delete
End Sub
 
Upvote 0
Fantastic!!!
Works a treat!

Not sure if it has helped Sisi001 out, as the original request for help was a couple of months ago , but you sure have made my job easier!!:biggrin:

Thank you very much!
Kind Regards

Bizzytech
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,565
Messages
6,179,549
Members
452,927
Latest member
rows and columns

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