+ Reply to Thread
Results 1 to 4 of 4

Clear data but not cell color and grid lines

  1. #1
    Forum Contributor
    Join Date
    10-22-2014
    Location
    Ontario
    MS-Off Ver
    365
    Posts
    306

    Clear data but not cell color and grid lines

    I have a spreadhseet where I tried to add a clear button to page 1. It works but is there a way to keep the cell color and grid lines?

    If I can add one more item. I want to also clear other cells and I tried adding them to the range but I doesn't work.

    This works:
    Set Rng = Worksheets(Sht).Range(“B8:F14”)

    This doesn't work:
    Set Rng = Worksheets(Sht).Range(“B8:F14”,”A6”,”I4”,”J4”,”K4")

    Much appreciated.

    PeterTips Oct 25d.xlsm

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Prof Plus 2019
    Posts
    6,989

    Re: Clear data but not cell color and grid lines

    Try this instead.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Forum Contributor
    Join Date
    10-22-2014
    Location
    Ontario
    MS-Off Ver
    365
    Posts
    306

    Re: Clear data but not cell color and grid lines

    Thank you so much.

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Prof Plus 2019
    Posts
    6,989

    Re: Clear data but not cell color and grid lines

    You're welcome and thanks for rep+.

+ 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] Color all the cells in a grid that contain 1, with the color that references text in cell
    By BullseyeThor in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 12-10-2023, 08:12 PM
  2. grid lines and cell fill
    By akj1944 in forum Excel General
    Replies: 4
    Last Post: 09-28-2013, 04:06 PM
  3. [SOLVED] Removing grid lines after last cell with data in it
    By boomboomblock in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-09-2013, 09:08 AM
  4. Preserving grid lines when color filling?
    By Fernando12 in forum Excel General
    Replies: 2
    Last Post: 07-10-2007, 02:47 PM
  5. no grid lines when colouring in a cell
    By stevec in forum Excel General
    Replies: 2
    Last Post: 07-12-2006, 01:10 PM
  6. [SOLVED] No grid lines with color
    By BK in forum Excel General
    Replies: 2
    Last Post: 06-22-2006, 05:10 PM
  7. [SOLVED] Be able to re-color INDIVIDUAL grid lines in excel charts
    By John Canino in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-15-2005, 01:06 AM

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