+ Reply to Thread
Results 1 to 11 of 11

How to delete or clear results that = 0 in a column?

  1. #1
    Registered User
    Join Date
    03-30-2015
    Location
    Fort Wayne, IN
    MS-Off Ver
    MS Office Professional 2013
    Posts
    5

    How to delete or clear results that = 0 in a column?

    Good Afternoon,

    Thank you in advance for the assistance. I am getting back into using VBA again so hopefully this won't be to difficult. I have pasted part of my work below to perform a small calculation of data on one sheet and fill in the answers on another sheet. I simply would like to either delete or clear a cell if the formula after the calculation. I have tried several ways, but it hasn't worked yet. Any suggestions at the simplest way to do this?

    Please Login or Register  to view this content.
    Thank you,
    MJ
    Last edited by MJ87; 03-30-2015 at 04:57 PM. Reason: Had to add code tags.

  2. #2
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383

    Re: How to delete or clear results that = 0 in a column?

    See if this does what you want...
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-30-2015
    Location
    Fort Wayne, IN
    MS-Off Ver
    MS Office Professional 2013
    Posts
    5

    Re: How to delete or clear results that = 0 in a column?

    Quote Originally Posted by ARowbot View Post
    See if this does what you want...
    Please Login or Register  to view this content.
    Thank you for the reply. It unfortunately does not work since it only applies to the Range("B1") and not the entire column of B. I tested it will a cell that contains 0 and replaced the code with B200 and it worked for that specific cell. Is there a way to make the range each cell in Column B?

  4. #4
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383

    Re: How to delete or clear results that = 0 in a column?

    There is probably a few ways to do it... 1 being:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-30-2015
    Location
    Fort Wayne, IN
    MS-Off Ver
    MS Office Professional 2013
    Posts
    5

    Re: How to delete or clear results that = 0 in a column?

    Quote Originally Posted by ARowbot View Post
    There is probably a few ways to do it... 1 being:
    Please Login or Register  to view this content.
    I put the code and ran it. Unfortunately that didn't work either. I wonder if VBA is not recognizing the 0's because I have the formula in each of the cells. I feel like yours should work.

  6. #6
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383

    Re: How to delete or clear results that = 0 in a column?

    Attach a spreadsheet and I will see if I can see any problems

  7. #7
    Registered User
    Join Date
    03-30-2015
    Location
    Fort Wayne, IN
    MS-Off Ver
    MS Office Professional 2013
    Posts
    5

    Re: How to delete or clear results that = 0 in a column?

    Here you go. Run the marketshare_squared_Objective macro. The code in question is found in module 1. Thank you.Excelsheet - Copy.xlsm
    Last edited by MJ87; 03-30-2015 at 06:18 PM. Reason: attached again

  8. #8
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383

    Re: How to delete or clear results that = 0 in a column?

    The reason it doesn't work is because you autofilled all of column B, so It cannot count the last used row. I am now attempting to tidy it up so it only autofills as far as necessary

  9. #9
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383

    Re: How to delete or clear results that = 0 in a column?

    Here is the new and improved version...

    atchm_10820 Test 1.xlsm

    If you want me to explain any step then let me know

  10. #10
    Registered User
    Join Date
    03-30-2015
    Location
    Fort Wayne, IN
    MS-Off Ver
    MS Office Professional 2013
    Posts
    5

    Re: How to delete or clear results that = 0 in a column?

    Quote Originally Posted by ARowbot View Post
    Here is the new and improved version...

    Attachment 386377

    If you want me to explain any step then let me know
    Great! Thank you. It looks awesome. I re-organized it a little. Did you add module 4 for any reason and what was the button for?

    MJ

  11. #11
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383

    Re: How to delete or clear results that = 0 in a column?

    You're welcome. Module 4 was just where I was re writing that part of the code. I added the button just so that I could easily run the macro Both are easily removed.

    If you're happy with the solution then mark the thread as solved by clicking thread tools and mark as solved.

    ARowbot

+ 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] If rowNow = 11 Clear Content of Row No delete
    By guitarsweety in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-26-2014, 12:50 PM
  2. Delete clear duplicate in A1
    By johnph in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2013, 08:42 PM
  3. Delete rows or Clear contents below a specific word is found in Column A
    By kishoremcp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-17-2012, 04:08 PM
  4. Clear (not Delete) Duplicate Values in Column
    By cda in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-14-2010, 12:02 PM
  5. Help to clear data & delete rows
    By Eddy Stan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-11-2006, 06:35 AM

Tags for this Thread

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