+ Reply to Thread
Results 1 to 11 of 11

clear cell contents without losing formulas

  1. #1
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    clear cell contents without losing formulas

    hi
    I have code linked to cammandbutton on sheet1,this clears contents of cells c3,c5,d3,d5 ect,to get back to clean sheet and not interfere with any formulas in those cells,what I can not do is get them blank,they have "name" instead,any ideas please
    cheers colin
    Attached Files Attached Files
    Last edited by cfinch100; 08-16-2014 at 12:00 PM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: clear cell contents without losing formulas

    =IFERROR(VLOOKUP(B5,AC$2:$AQ$76,5,FALSE),NA) is wrong
    that needs to be
    =IFERROR(VLOOKUP(B5,AC$2:$AQ$76,5,FALSE),"NA") or =IFERROR(VLOOKUP(B5,AC$2:$AQ$76,5,FALSE),NA())
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: clear cell contents without losing formulas

    Change your formulas so that rather than have NA as the last argument they have "".

    So =IFERROR(VLOOKUP(B3,AC$2:$AQ$76,5,FALSE),NA) becomes =IFERROR(VLOOKUP(B3,AC$2:$AQ$76,5,FALSE),"")

  4. #4
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: clear cell contents without losing formulas

    hi
    thanks for that,have amended formula and now have na in place of name ,how can I just have it blank
    cheers colin

  5. #5
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: clear cell contents without losing formulas

    Quote Originally Posted by cfinch100 View Post
    hi
    thanks for that,have amended formula and now have na in place of name ,how can I just have it blank
    cheers colin

    Look at post #3

  6. #6
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: clear cell contents without losing formulas

    hi badlyspelledbouy
    yeh got that thanks and changed it, only problem "c3" and "c5" after I changed na to "" and ran commandbutton, the formula changed itself to na
    again,so have "name " back again
    cheers colin

  7. #7
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: clear cell contents without losing formulas

    Very bizarre. It doesn't for me. See attached.

    Are you sure you changed ALL the formulas?
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: clear cell contents without losing formulas

    hi
    have just tried yours and if enter in first combobox it fills first 4 with tackle shop and click on commandbutton and enters name in c3 and c5 again like mine that is weird
    cheers colin

  9. #9
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: clear cell contents without losing formulas

    hi
    definitely is changing "" to na by itself
    cheers colin

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: clear cell contents without losing formulas

    thats because you have written it into the combo box change code if you want that to change then instead of NA you need """"
    Please Login or Register  to view this content.
    for each one

  11. #11
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: clear cell contents without losing formulas

    hi
    thought it would be something id done
    many thanks to both of you
    cheers colin

+ 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 - no formulas
    By Lukael in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-17-2014, 12:22 PM
  2. Clear cell contents on closing/opening without clearing formulas
    By CFT Brian in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-28-2013, 03:47 PM
  3. 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
  4. [SOLVED] [SOLVED] Excel should let me clear cell contents without clearing formulas
    By BJM in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-19-2005, 01:00 PM
  5. How do I clear data values wthout losing the formulas?
    By genaksdal in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-08-2005, 01:50 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