Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Mar 2004
    Location
    London, Gtr London, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    delete row with active cell, shortcut? (2003)

    I would like a quick way to delete the row which contains the active cell, ideally with just a single key press, maybe a function key. I scroll down until I find a row with the data I want rid of, hit the key and the row is gone. is this doable by recording a macro? Thanks in advance Frank

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: delete row with active cell, shortcut? (2003)

    Yes - the macro would just be:
    <code>Activecell.EntireRow.Delete</code>

    HTH
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: delete row with active cell, shortcut? (2003)

    Add the following macro to your Personal.xls macro workbook:

    Sub DeleteRow()
    On Error Resume Next
    ActiveCell.EntireRow.Delete
    End Sub

    Select the macro in the list in Tools | Macro | Macros... (it'll be listed as Personal.xls!DeleteRow), click Options and assign a keyboard shortcut.

    See Legare Coleman's Personal.xls Tutorial (All) for more info about Personal.xls.

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: delete row with active cell, shortcut? (2003)

    You can also add the builtin "delete rows" button to the current toolbar and not require any coding

    Steve

  5. #5
    5 Star Lounger
    Join Date
    Aug 2004
    Location
    Connecticut, USA
    Posts
    816
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: delete row with active cell, shortcut? (2003)

    How about 3 key strokes:

    Ctrl+ - on (the number pad or by the backspace)
    R
    Enter

  6. #6
    3 Star Lounger
    Join Date
    Mar 2004
    Location
    London, Gtr London, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: delete row with active cell, shortcut? (2003)

    Thanks everyone, all useful suggestions. I did not know about the toolbar button!
    The code works well, I wish I could assign something other thank Ctrl-<letter> cominations to the macro.
    Frank

  7. #7
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: delete row with active cell, shortcut? (2003)

    or a slight variation:
    Shift + spacebar, then
    Ctrl+ - on (the number pad or by the backspace)
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

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