+ Reply to Thread
Results 1 to 2 of 2

Macro that double spaces rows for an entire worksheet?

  1. #1
    glaves123
    Guest

    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. #2
    Jim Cone
    Guest

    Re: 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" <[email protected]>
    wrote in message
    news:[email protected]

    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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1