+ Reply to Thread
Results 1 to 4 of 4

Clear Data, Leave Borders

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-07-2014
    Location
    Nottingham
    MS-Off Ver
    Office 2016, Office 365
    Posts
    400

    Clear Data, Leave Borders

    I have the following code in a worksheet:

    Sub CLEAR_DATA()
    
    Range("OT_Hours").Clear
    
    End Sub
    Is there any way of clearing the data in the range, but for it to not remove the Cell Borders?

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,641

    Re: Clear Data, Leave Borders

    Hi there,

    Try:

    
    Range("OT_Hours").ClearContents

    Hope this helps.

    Regards,

    Greg M

  3. #3
    Forum Contributor
    Join Date
    07-07-2014
    Location
    Nottingham
    MS-Off Ver
    Office 2016, Office 365
    Posts
    400

    Re: Clear Data, Leave Borders

    Awesome. thank you

    Unable to give you Rep for this.
    Last edited by DarrylBurge; 04-08-2024 at 06:26 AM. Reason: Editing

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,641

    Re: Clear Data, Leave Borders

    Hi again,

    Many thanks for your feedback.

    Unable to give you Rep for this.
    No problem, thanks for trying!

    Regards,

    Greg M

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] clear contents of cells but leave formulae intact VBA
    By freeriding in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-22-2019, 05:40 PM
  2. Clear cell contents but leave formulas
    By davidcrawt in forum Excel General
    Replies: 4
    Last Post: 05-14-2017, 01:44 AM
  3. [SOLVED] Copy only borders and leave other formats
    By JackBauer in forum Excel General
    Replies: 2
    Last Post: 11-04-2015, 05:55 AM
  4. Clear Extra Cells After Data But Preserve Cell Borders
    By DavidIII in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-17-2013, 11:23 AM
  5. Macro to clear some data within a cell but leave other data
    By JimmiOO in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-24-2009, 09:04 AM
  6. [SOLVED] Clear contents but leave formulas in Excel
    By ojchippy in forum Excel - New Users/Basics
    Replies: 10
    Last Post: 06-16-2006, 11:15 PM
  7. How to clear the cell borders ?
    By Zul in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 01-31-2005, 07:02 PM

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