+ Reply to Thread
Results 1 to 3 of 3

Delete selected range

  1. #1
    RW
    Guest

    Delete selected range

    Here's the code

    Set WshD = ThisWorkBook.WorkSheets("index")
    Set RngD = WshD.Range("M65536".End(xlUP)
    RngD = RngD.Offset(0,-12).Resize(11,12).Delete

    I've also used Select in place of Delete above and then added
    Selection.Delete on the next line.
    I used the Offset before resize since I read in this forum that Resize
    doesn't like negative values.

    How do I delete the newly selected range?

  2. #2
    Tom Ogilvy
    Guest

    Re: Delete selected range

    Set WshD = ThisWorkBook.WorkSheets("index")
    Set RngD = WshD.Range("M65536".End(xlUP)
    RngD.Offset(0,-12).Resize(11,12).Delete Shift:=xlShiftUp

    --
    Regards,
    Tom Ogilvy


    "RW" <RW@discussions.microsoft.com> wrote in message
    news:EAE5D49E-4B3C-431F-A23C-C61041D85166@microsoft.com...
    > Here's the code
    >
    > Set WshD = ThisWorkBook.WorkSheets("index")
    > Set RngD = WshD.Range("M65536".End(xlUP)
    > RngD = RngD.Offset(0,-12).Resize(11,12).Delete
    >
    > I've also used Select in place of Delete above and then added
    > Selection.Delete on the next line.
    > I used the Offset before resize since I read in this forum that Resize
    > doesn't like negative values.
    >
    > How do I delete the newly selected range?




  3. #3
    RW
    Guest

    Re: Delete selected range

    Thanks!

    "Tom Ogilvy" wrote:

    > Set WshD = ThisWorkBook.WorkSheets("index")
    > Set RngD = WshD.Range("M65536".End(xlUP)
    > RngD.Offset(0,-12).Resize(11,12).Delete Shift:=xlShiftUp
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "RW" <RW@discussions.microsoft.com> wrote in message
    > news:EAE5D49E-4B3C-431F-A23C-C61041D85166@microsoft.com...
    > > Here's the code
    > >
    > > Set WshD = ThisWorkBook.WorkSheets("index")
    > > Set RngD = WshD.Range("M65536".End(xlUP)
    > > RngD = RngD.Offset(0,-12).Resize(11,12).Delete
    > >
    > > I've also used Select in place of Delete above and then added
    > > Selection.Delete on the next line.
    > > I used the Offset before resize since I read in this forum that Resize
    > > doesn't like negative values.
    > >
    > > How do I delete the newly selected range?

    >
    >
    >


+ 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