Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
inserting lines throughout a spreadsheet
If I have a spreadsheet and I make it where there are blank cells between by
data, I then sort and the blank lines are then removed. How do I easily insert blank cells throught by spreadsheet without physically inserting the row on every line. |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
inserting lines throughout a spreadsheet
Kerry
This macro will do that for you. I assumed you have data in Column A starting with A2 (A1 is a header). Change the column and row as needed. HTH Otto Sub InsertBlank() Dim RngColA As Range Dim c As Long Application.ScreenUpdating = False Set RngColA = Range("A2", Range("A" & Rows.Count).End(xlUp)) For c = RngColA.Count To 1 Step -1 RngColA(c).Offset(1).EntireRow.Insert Next c Application.ScreenUpdating = True End Sub "kerry" wrote in message ... If I have a spreadsheet and I make it where there are blank cells between by data, I then sort and the blank lines are then removed. How do I easily insert blank cells throught by spreadsheet without physically inserting the row on every line. |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
inserting lines throughout a spreadsheet
The macro worked greated. However, I do my sort, run the macro, then it does
not keep the sort. it puts it back in the same order it was in. Can you sort, run macro, and have it keep the sort you ran? "Otto Moehrbach" wrote: Kerry This macro will do that for you. I assumed you have data in Column A starting with A2 (A1 is a header). Change the column and row as needed. HTH Otto Sub InsertBlank() Dim RngColA As Range Dim c As Long Application.ScreenUpdating = False Set RngColA = Range("A2", Range("A" & Rows.Count).End(xlUp)) For c = RngColA.Count To 1 Step -1 RngColA(c).Offset(1).EntireRow.Insert Next c Application.ScreenUpdating = True End Sub "kerry" wrote in message ... If I have a spreadsheet and I make it where there are blank cells between by data, I then sort and the blank lines are then removed. How do I easily insert blank cells throught by spreadsheet without physically inserting the row on every line. |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
inserting lines throughout a spreadsheet
Kerry
The macro I gave you does nothing with the sort. It simply takes what's there and inserts a blank row after every row of data you have. If your data is being sorted after my macro runs, then you must have other macros running after mine. I don't know what your file has or how it operates so I can't advise you there, but the macro I sent you does not sort anything. HTH Otto "kerry" wrote in message ... The macro worked greated. However, I do my sort, run the macro, then it does not keep the sort. it puts it back in the same order it was in. Can you sort, run macro, and have it keep the sort you ran? "Otto Moehrbach" wrote: Kerry This macro will do that for you. I assumed you have data in Column A starting with A2 (A1 is a header). Change the column and row as needed. HTH Otto Sub InsertBlank() Dim RngColA As Range Dim c As Long Application.ScreenUpdating = False Set RngColA = Range("A2", Range("A" & Rows.Count).End(xlUp)) For c = RngColA.Count To 1 Step -1 RngColA(c).Offset(1).EntireRow.Insert Next c Application.ScreenUpdating = True End Sub "kerry" wrote in message ... If I have a spreadsheet and I make it where there are blank cells between by data, I then sort and the blank lines are then removed. How do I easily insert blank cells throught by spreadsheet without physically inserting the row on every line. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Want to Automatically Re-Categorize a Downloaded Internet Spreadsheet | Excel Discussion (Misc queries) | |||
How do I sort records that are on two lines in a spreadsheet? | Excel Worksheet Functions | |||
Inserting Lines or Copying lines with formulas but without data | Excel Discussion (Misc queries) | |||
Code for Inserting Multiple lines | Excel Discussion (Misc queries) | |||
Why when I print out a spreadsheet on Excel it doesn't have lines | Excel Discussion (Misc queries) |