Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
glaves123
 
Posts: n/a
Default Macro that double spaces rows for an entire worksheet?

Hello,
I regularly import data into excel and then need to double space every row
manually, or add a new empty row between each line of data manually. Does
anyone know a macro where I can highlight all of the worksheet data, run the
macro, and everything will be double spaced automatically? Thanks for any
input!
Gary
  #2   Report Post  
Jim Cone
 
Posts: n/a
Default Macro that double spaces rows for an entire worksheet?

Gary,
Give this a try...
'---------------------
Sub I_Need_Space()
'Inserts a row between every row in the selection.
'Jim Cone - San Francisco, USA - November 05, 2005
Dim rngSelect As Excel.Range
Dim lngRow As Long
Set rngSelect = Selection.Columns(1)
If rngSelect.Rows.Count = Rows.Count Then
If MsgBox("Every row is selected. Do you want to continue ? ", _
vbQuestion + vbOKCancel, " Gary's Idea") = vbCancel Then
Set rngSelect = Nothing
Exit Sub
End If
End If
Application.ScreenUpdating = False
For lngRow = rngSelect.Rows.Count To 2 Step -1
rngSelect.Rows(lngRow).EntireRow.Insert
Next 'lngRow
Application.ScreenUpdating = True
Set rngSelect = Nothing
End Sub
'-----------------

"glaves123"
wrote in message


Hello,
I regularly import data into excel and then need to double space every row
manually, or add a new empty row between each line of data manually. Does
anyone know a macro where I can highlight all of the worksheet data, run the
macro, and everything will be double spaced automatically? Thanks for any
input!
Gary
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
Compare and consolidating duplicated rows Jen Excel Discussion (Misc queries) 24 March 4th 08 08:49 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
copy rows meeting criteria to another worksheet confused Excel Worksheet Functions 4 October 4th 05 11:51 AM
Insert rows Mr. G. Excel Worksheet Functions 3 March 31st 05 03:49 AM
Macro to simply bring up the Find dialogue box?? marika1981 Excel Discussion (Misc queries) 14 January 14th 05 10:47 PM


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