Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 72
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,090
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 72
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,090
Default 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
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
Want to Automatically Re-Categorize a Downloaded Internet Spreadsheet The Moose Excel Discussion (Misc queries) 2 October 13th 06 10:24 AM
How do I sort records that are on two lines in a spreadsheet? ecox Excel Worksheet Functions 2 August 22nd 06 08:43 PM
Inserting Lines or Copying lines with formulas but without data wnfisba Excel Discussion (Misc queries) 2 August 18th 06 04:41 PM
Code for Inserting Multiple lines Frantic Excel-er Excel Discussion (Misc queries) 0 June 17th 05 06:36 PM
Why when I print out a spreadsheet on Excel it doesn't have lines johnson001 Excel Discussion (Misc queries) 3 March 14th 05 03:56 PM


All times are GMT +1. The time now is 09:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"