+ Reply to Thread
Results 1 to 6 of 6

clear contents of range

  1. #1
    Registered User
    Join Date
    10-30-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    52

    clear contents of range

    Why doesn't this code work?

    Please Login or Register  to view this content.
    But this code works:
    Please Login or Register  to view this content.
    Thanks.

    Also, if I do have to use the bottom code, is there a way of "unselecting" the range after it's been cleared? Without then selecting A1...

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: clear contents of range

    Please Login or Register  to view this content.
    Should also work as long as you have data in Column A of sheet "DO"

    What the line does: Select rows 4, column 1 up to last row and column 145. I suspect the the last row -"r" does not go down the way you wanted it because you may not have data in Colulmn A of sheet "DO".
    Could you check what is the last data entry in sheet "DO" Column "A"?

  3. #3
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: clear contents of range

    the first code workks, Just tested.
    If solved remember to mark Thread as solved

  4. #4
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: clear contents of range

    Hi -

    Put .address
    Please Login or Register  to view this content.
    Regards,
    Event

  5. #5
    Registered User
    Join Date
    10-30-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: clear contents of range

    I tried the code on a different range just incase "r" was messing it up....

    Please Login or Register  to view this content.
    Run time error!
    I really don't know why it's not working

  6. #6
    Registered User
    Join Date
    10-30-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: clear contents of range

    Yay that fixed it (.Address)!
    Thanks so much

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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