LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Inserting a BLANK row

Tom,

It's not copying anything, if the original cells have borders then these
will be stretched when the new rows are inserted. This will remove them but
it's a bit of a mess because I don't know what borders I'm dealing with.

Sub insertrows()
lastrowcolc = Range("C65536").End(xlUp).Row
For x = lastrowcolc To 2 Step -1
Rows(x).Select
Selection.Insert Shift:=xlDown
Cells(x, 3).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Next
End Sub

"Tom" wrote:

Hi Mike,
Thanks for taking the time to respond with a solution. This code does
work...however, can it be changed so that it does not copy the cell formats
from above/below....ie, cell border formatting. i would like the cells
completely empty with no borders on them. The cells above/below them DO have
borders and I'm assuming that this is copying the cell format from them.

thanks!

"Mike" wrote:

Sorry should be

For x = lastrowcolc To 34 Step -1


"Mike" wrote:

Try this. Finds the last used row in Col C and inserts a blank line between
rows up to row 33.

Sub insertrows()
lastrowcolc = Range("C65536").End(xlUp).Row
For x = lastrowcolc To 2 Step -1
Rows(x).Select
Selection.Insert Shift:=xlDown
Next
End Sub

Mike


"Tom" wrote:

Hi all,
I have a sheet that has a range that starts from row 33 and MAY (depending
on how many parameters/rows of data are required) extend up to row 43. What I
would like to do is insert a BLANK row between the lines of data. (Data is
column C).
I think the best way would be to search from row 33 down to see where the
last row of data is, then insert blank rows between the lines that contain
data.
Any help would be greatly appreciated!

 
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 blank rows PL Excel Discussion (Misc queries) 4 December 16th 09 02:35 PM
Inserting blank rows plus using Sum Bill95051 New Users to Excel 3 April 8th 09 07:38 PM
Inserting a blank row after subtitle row jcontrer Excel Discussion (Misc queries) 3 July 22nd 08 10:45 PM
inserting a blank row mrselkoil Excel Discussion (Misc queries) 1 January 24th 07 09:18 PM
Inserting blank columns poppy Excel Programming 2 July 20th 04 07:54 AM


All times are GMT +1. The time now is 06:28 PM.

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"