+ Reply to Thread
Results 1 to 9 of 9

Resetting all fields to zero is removing certain cells formulas

  1. #1
    Registered User
    Join Date
    12-06-2015
    Location
    Michigan
    MS-Off Ver
    Office 365
    Posts
    79

    Question Resetting all fields to zero is removing certain cells formulas

    I'm trying to reset all my cells that have prices to zero; this code works, but removes some formulas:

    Please Login or Register  to view this content.
    I even tried this one, not knowing if it'll make any differences:

    Please Login or Register  to view this content.
    I have merged cells. I've even tried incorporating those merged cells ranges into the range VBA and still have the same problem. So, all in all, some cells have their formulas, but other cells formulas are being removed. How can I keep all cells with their respected formulas, while resetting fields to zero?
    Attached Files Attached Files
    Last edited by clogistics; 03-14-2020 at 08:18 AM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Resetting all fields to zero is removing certain cells formulas

    You need to check for the presence of a formula.

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    12-06-2015
    Location
    Michigan
    MS-Off Ver
    Office 365
    Posts
    79

    Re: Resetting all fields to zero is removing certain cells formulas

    Thanks for the quick reply back. The code you gave me didn't zero out the cells that had formulas. Additionally, which I should've added in the initial post, how would you go about implementing this with columns? My original code was able to get everything to zero, even across columns, but just removed some formulas while leaving other formulas intact.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Resetting all fields to zero is removing certain cells formulas

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 03-14-2020 at 05:21 AM.

  5. #5
    Registered User
    Join Date
    12-06-2015
    Location
    Michigan
    MS-Off Ver
    Office 365
    Posts
    79

    Re: Resetting all fields to zero is removing certain cells formulas

    The last code looks like it added zero's to every single cell, but it did zero out every cell but didn't zero out them all. It wasn't what I was looking for (as far as zero out every cell). So, I attached a file to this post, so I could add more clarity. I should've originally added the file to limit confusion on what I was trying to request about. Once again, thanks for reaching out to help.

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Resetting all fields to zero is removing certain cells formulas

    How about
    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Resetting all fields to zero is removing certain cells formulas

    Based on Fluffs Solution.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    12-06-2015
    Location
    Michigan
    MS-Off Ver
    Office 365
    Posts
    79

    Re: Resetting all fields to zero is removing certain cells formulas

    Both of these codes worked! Thanks mehmetcik, for your help through this, and thanks Fluff13 adding your input as well. I really appreciate the help.

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Resetting all fields to zero is removing certain cells formulas

    You're welcome & thanks for the feedback

+ 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. Replies: 5
    Last Post: 03-07-2018, 05:18 AM
  2. Resetting Fields in a Protected Worksheet
    By dgauthier in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-24-2017, 09:34 AM
  3. Removing All Pivot Fields from a Row Label except for one
    By akwishestofish in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-07-2012, 11:39 AM
  4. Macros for resetting formulas
    By clundeen in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-31-2011, 11:17 AM
  5. Removing spaces throughout various fields
    By fretwizard in forum Excel General
    Replies: 8
    Last Post: 12-15-2008, 02:02 PM
  6. [SOLVED] Advice needed on clearing cells without removing formulas
    By Digital2k in forum Excel General
    Replies: 12
    Last Post: 07-02-2006, 05:55 PM
  7. Replies: 1
    Last Post: 05-15-2006, 03:43 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