+ Reply to Thread
Results 1 to 5 of 5

Macro to delete a group of CELLS

  1. #1
    Guest

    Macro to delete a group of CELLS

    I am trying to get a macro to delete a group of cells as I parse down
    through the block of instrument data, to weed out blanks or corrupt data. I
    just want the macro to delete the 4 or 5 adjacent cells and move the data
    block up (similar to a right click delete- which asks if you want up, right
    left or entire row, etc

    Sub delete()
    '
    ' delete Macro
    ' Macro recorded 5/5/2006 by Paul
    '
    ' Keyboard Shortcut: Ctrl+d
    '
    Range("E2378:L2378").Select
    Selection.delete Shift:=xlUp
    End Sub.

    Only problem with recorder is it goes to a defined cell. I would like my
    macro to work wherever the cursor is- not always at E:2378 to L:2378

    I appreciate the help!

    Thanks
    Paul



  2. #2
    Don Guillett
    Guest

    Re: Macro to delete a group of CELLS

    Have you tried without

    Range("E2378:L2378").Select

    --
    Don Guillett
    SalesAid Software
    [email protected]
    <[email protected]> wrote in message
    news:[email protected]...
    >I am trying to get a macro to delete a group of cells as I parse down
    >through the block of instrument data, to weed out blanks or corrupt data.
    >I just want the macro to delete the 4 or 5 adjacent cells and move the data
    >block up (similar to a right click delete- which asks if you want up, right
    >left or entire row, etc
    >
    > Sub delete()
    > '
    > ' delete Macro
    > ' Macro recorded 5/5/2006 by Paul
    > '
    > ' Keyboard Shortcut: Ctrl+d
    > '
    > Range("E2378:L2378").Select
    > Selection.delete Shift:=xlUp
    > End Sub.
    >
    > Only problem with recorder is it goes to a defined cell. I would like my
    > macro to work wherever the cursor is- not always at E:2378 to L:2378
    >
    > I appreciate the help!
    >
    > Thanks
    > Paul
    >




  3. #3
    Guest

    Re: Macro to delete a group of CELLS

    Works like a charm. Thanks!

    Paul


    "Don Guillett" <[email protected]> wrote in message
    news:%23%[email protected]...
    > Have you tried without
    >
    > Range("E2378:L2378").Select
    >
    > --
    > Don Guillett
    > SalesAid Software
    > [email protected]
    > <[email protected]> wrote in message
    > news:[email protected]...
    >>I am trying to get a macro to delete a group of cells as I parse down
    >>through the block of instrument data, to weed out blanks or corrupt data.
    >>I just want the macro to delete the 4 or 5 adjacent cells and move the
    >>data block up (similar to a right click delete- which asks if you want up,
    >>right left or entire row, etc
    >>
    >> Sub delete()
    >> '
    >> ' delete Macro
    >> ' Macro recorded 5/5/2006 by Paul
    >> '
    >> ' Keyboard Shortcut: Ctrl+d
    >> '
    >> Range("E2378:L2378").Select
    >> Selection.delete Shift:=xlUp
    >> End Sub.
    >>
    >> Only problem with recorder is it goes to a defined cell. I would like my
    >> macro to work wherever the cursor is- not always at E:2378 to L:2378
    >>
    >> I appreciate the help!
    >>
    >> Thanks
    >> Paul
    >>

    >
    >




  4. #4
    Don Guillett
    Guest

    Re: Macro to delete a group of CELLS

    glad to help

    --
    Don Guillett
    SalesAid Software
    [email protected]
    <[email protected]> wrote in message
    news:[email protected]...
    > Works like a charm. Thanks!
    >
    > Paul
    >
    >
    > "Don Guillett" <[email protected]> wrote in message
    > news:%23%[email protected]...
    >> Have you tried without
    >>
    >> Range("E2378:L2378").Select
    >>
    >> --
    >> Don Guillett
    >> SalesAid Software
    >> [email protected]
    >> <[email protected]> wrote in message
    >> news:[email protected]...
    >>>I am trying to get a macro to delete a group of cells as I parse down
    >>>through the block of instrument data, to weed out blanks or corrupt data.
    >>>I just want the macro to delete the 4 or 5 adjacent cells and move the
    >>>data block up (similar to a right click delete- which asks if you want
    >>>up, right left or entire row, etc
    >>>
    >>> Sub delete()
    >>> '
    >>> ' delete Macro
    >>> ' Macro recorded 5/5/2006 by Paul
    >>> '
    >>> ' Keyboard Shortcut: Ctrl+d
    >>> '
    >>> Range("E2378:L2378").Select
    >>> Selection.delete Shift:=xlUp
    >>> End Sub.
    >>>
    >>> Only problem with recorder is it goes to a defined cell. I would like
    >>> my macro to work wherever the cursor is- not always at E:2378 to L:2378
    >>>
    >>> I appreciate the help!
    >>>
    >>> Thanks
    >>> Paul
    >>>

    >>
    >>

    >
    >




  5. #5
    Guest

    Re: Macro to delete a group of CELLS

    Does the same approach work to prompts to load a file into a worksheet so
    that I chose the file/path and filename instead of having it cast in stone
    each time?

    Thanks
    Paul


    "Don Guillett" <[email protected]> wrote in message
    news:%[email protected]...
    > glad to help
    >
    > --
    > Don Guillett
    > SalesAid Software
    > [email protected]
    > <[email protected]> wrote in message
    > news:[email protected]...
    >> Works like a charm. Thanks!
    >>
    >> Paul
    >>
    >>
    >> "Don Guillett" <[email protected]> wrote in message
    >> news:%23%[email protected]...
    >>> Have you tried without
    >>>
    >>> Range("E2378:L2378").Select
    >>>
    >>> --
    >>> Don Guillett
    >>> SalesAid Software
    >>> [email protected]
    >>> <[email protected]> wrote in message
    >>> news:[email protected]...
    >>>>I am trying to get a macro to delete a group of cells as I parse down
    >>>>through the block of instrument data, to weed out blanks or corrupt
    >>>>data. I just want the macro to delete the 4 or 5 adjacent cells and move
    >>>>the data block up (similar to a right click delete- which asks if you
    >>>>want up, right left or entire row, etc
    >>>>
    >>>> Sub delete()
    >>>> '
    >>>> ' delete Macro
    >>>> ' Macro recorded 5/5/2006 by Paul
    >>>> '
    >>>> ' Keyboard Shortcut: Ctrl+d
    >>>> '
    >>>> Range("E2378:L2378").Select
    >>>> Selection.delete Shift:=xlUp
    >>>> End Sub.
    >>>>
    >>>> Only problem with recorder is it goes to a defined cell. I would like
    >>>> my macro to work wherever the cursor is- not always at E:2378 to L:2378
    >>>>
    >>>> I appreciate the help!
    >>>>
    >>>> Thanks
    >>>> Paul
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >




+ 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