LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Inserting 10 rows after a specific row

Hi Norman,

thanks
a lot for the fast reply. I have test it but it seems that is not working as
expected.
In fact if you run several time the same code you will see that it keeps
adding 10 rows instead of just overwritting the existing new 10 rows.

Do you have time to have a look ? also How can I change the code so the
rCell is equal to the current selected row (and not the "A15")


"Norman Jones" wrote:

Hi Stabilo,

Try:

'=======================
Public Sub Tester()
Dim rCell As Range

Application.ScreenUpdating = True

Set rCell = Range("A15") '<<=========== CHANGE

rCell(2).Resize(10).EntireRow.Insert shift:=xlUp
rCell.EntireRow.Copy
rCell.Offset(1).Resize(10).PasteSpecial Paste:=xlPasteFormats
With Application
.CutCopyMode = False
.ScreenUpdating = True
End With
End Sub
'<<=======================


---
Regards,
Norman



"stabilo" wrote in message
...
I need to insert 10 rows after a specifc row (let's call it source row) and
the new rows have to have the same formating as the source row.

So if I have a cell on row 15 selected, the macro should insert 10 row
below
row 15 with the same formating (eg. border, shading, font,...) wihtout the
values .

Has it be already done ? thanks





 
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
Inserting numerous blank lines between specific rows of data Deb Excel Discussion (Misc queries) 5 December 22nd 09 05:01 PM
INserting Specific Number of Rows via macro [email protected] Links and Linking in Excel 1 November 14th 06 09:56 PM
inserting value if another cell contains a specific word exceluser2 Excel Discussion (Misc queries) 3 March 1st 06 07:07 PM
inserting specific # of rows cwinters Excel Discussion (Misc queries) 1 June 6th 05 07:30 PM
copy/inserting rows at specific intervals mark Excel Programming 1 October 17th 03 10:58 PM


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