Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Inserting blank rows | Excel Discussion (Misc queries) | |||
Inserting blank rows plus using Sum | New Users to Excel | |||
Inserting a blank row after subtitle row | Excel Discussion (Misc queries) | |||
inserting a blank row | Excel Discussion (Misc queries) | |||
Inserting blank columns | Excel Programming |