Software
Houzz Logo Print
lynn237

Excel help Needed

18 years ago

I have an excel document with a list of names and addresses and phone numbers. This list is about 400 names long.

I would now like to skip a line between each name. Is it possible to do this now.

Thanks for any help.

Comments (3)

  • 18 years ago

    Checking that I have understood your question correctly i.e. you want to insert a blank row between each name on your list, then creating a "macro" in Excel makes this task quick and easy.

    BUT be sure to make a copy of your original data giving it a NEW DIFFERENT filename before you start playing!

    Running this macro twice will give two blank rows - but remember if you want to undo the changes made by ANY macro you have to do it the hard way - the undo button never works!

    Here's a simple way to create this macro without any technical knowledge:

    First, copy the following lines of code onto the clipboard ready to be pasted into Excel.

    Sub AddRows()

    Dim r As Long
    Dim LastRow As Long

    Application.ScreenUpdating = False
    LastRow = ActiveSheet.UsedRange.Row - 1 + _
    ActiveSheet.UsedRange.Rows.Count
    Application.ScreenUpdating = False
    '\***You can change LastRow 1 below to stop at any row number ***
    For r = LastRow To 1 Step -1
    If Application.CountA(Rows(r)) 0 Then Rows(r + 1).Insert
    Shift=xlDown
    Next r
    End Sub

    Then open your NEW DIFFERENT file in Excel.
    Right click on the Sheet tab at the bottom.
    Left click on View Code.
    A new window opens.
    Right click in this new window and paste the copied code into it.

    Click on the Excel icon at the top left end of the normal Excel toolbar.
    The normal Excel worksheet pops up on top of the previous screen.
    Save the file (which now includes the macro) as normal but, ideally, give it another new name.
    Shut down Excel (just to make sure that everything works properly next time - no reason why it won't).

    Now check that it works:

    Re-start Excel and click to open your new file.

    Depending on your security settings, Excel may ask if you want to "Enable Macros" every time you open the file. Since you created this macro you know that it is safe but be cautious about running macros from unknown sources because they can be infected.

    So, click "Enable Macros".
    Your file opens as normal.
    Then, on the top Excel toolbar click on Tools > Macro > Macros... > Select the new macro title that appears in the Macro window that pops up > Run.

    The blank rows are inserted.
    Save the final version of your data file.

    p.s. This macro is safe because it will only operate if you click its "Run button". It cannot make unexpected changes to your file.

  • 18 years ago

    WOW! Bee4mee, it worked.
    I am so impressed. I printed your instructions and followed them to the letter and voila my document was spaced.
    Thank you so much. Are you some kind of an excel instructor or what?
    A million thanks

  • 18 years ago

    Thanks for the feedback Lyban. Isn't it great when a computer does what you tell it to do!

    No I am not an Excel expert - I wrote the instructions but I found the clever part - the code on one of the many free Usenet newsgroups and then changed it slightly to do what you wanted.

    The newsgroups that I am referring to include: microsoft.public.Excel.newusers - microsoft.public.Excel.misc - microsoft.public.Word.newusers etc.etc.

    Practically all aspects of Microsoft Office are catered for - just subscribe (free) to the ones that interest you. N.B. there are literally thousands of newsgroups covering every subject under the sun - but be cautious what you choose to view or download.

    (On the Microsoft newsgroups the experts read all the groups so there is no need to post a question in several places when you are not sure which is the right group.)

    I read the newsgroups using a free News Account that I set up in Outlook Express (next tab to the Mail Accounts). If your ISP does not carry newsgroups then do as I do - use the excellent free service provided by http://news.motzarella.org/.

    You can also read newsgroups through Google Groups, but I find the "proper way" much better.

    Here is a link that might be useful: http://news.motzarella.org/

Sponsored
Interior Style, LLC
Average rating: 4.9 out of 5 stars60 Reviews
Northern Virginia Interior Designer - Best of Houzz 2013-2020!