Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Compare and consolidating duplicated rows | Excel Discussion (Misc queries) | |||
Closing File Error | Excel Discussion (Misc queries) | |||
copy rows meeting criteria to another worksheet | Excel Worksheet Functions | |||
Insert rows | Excel Worksheet Functions | |||
Macro to simply bring up the Find dialogue box?? | Excel Discussion (Misc queries) |