Consulting

Results 1 to 3 of 3

Thread: Solved: Clear all within range

  1. #1
    VBAX Contributor
    Joined
    May 2007
    Posts
    128
    Location

    Solved: Clear all within range

    Dear Experts

    I use following codes to clear data from range("a6") to lastrow
    With Sheets("Rpt_Daily")
        Range(.Cells(6, 1), .Cells(65536,1).End(xlUp)).EntireRow.ClearContents
    End with
    But it only clear data, not format.
    How to clear Data and Format within given range?

    I want to clear (data + borders + color etc)

    Please help

  2. #2
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    [VBA]
    With Sheets("Rpt_Daily")
    Range(.Cells(6, 1), .Cells(65536,1).End(xlUp)).EntireRow.Clear
    End with
    [/VBA]
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    tqm1, it's about time you did some work of your own rather than posting other peoples code on different forums!, you were answered at excel forum by the person below!

    ska67can vbmenu_register("postmenu_1794000", true);
    Registered User
    Join Date: Jan 2007
    Posts: 49


    Code:
    [VBA]
    With Sheets("Report-1") Range(.Cells(6, 1), .Cells(65536, 1).End(xlUp)).EntireRow.ClearContents
    End With
    [/VBA]

    ska
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

Posting Permissions

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