+ Reply to Thread
Results 1 to 6 of 6

Formula in cell becomes ineffective when other cells updated from userform

  1. #1
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Formula in cell becomes ineffective when other cells updated from userform

    Hi all,
    Contents formula =countif(B1:D1,"YES").
    This works fine.
    Column1 has simple formula to count if text is equal to 'YES'.
    But when I double click any cell in column 1 to open userform and update values in column 2,3,4
    then the formula in column1 does not work.
    I did try to figure out why? but need some help please.
    Thanks. sample book attached
    Kind regards
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Formula in cell becomes ineffective when other cells updated from userform

    Hi, when you open the form you take the current result from the formula in the TextBox1. When click update you overwrite the cell with the formula and put in the cell this OLD value from TextBox1.
    If you are pleased with a member's answer then use the Star icon to rate it.

  3. #3
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Formula in cell becomes ineffective when other cells updated from userform

    Hi buran,
    Thanks.
    To be honest , can you explain a bit more on this and if possible how would you achieve solution.
    Many thanks

  4. #4
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Formula in cell becomes ineffective when other cells updated from userform

    In your form you have 4 textboxes. TextBox1 is populated with the value from column A when you open the form. The other 3 are populated with values from columns B:D. When you click update buton, you overwrite the formula and place in column A the value from textbox1, which is the count WHEN THE FORM WAS OPENED, not after the update.
    The solution:

    Please Login or Register  to view this content.
    Note that I also changed
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    . You must change CommandButton2_Click sub the same way. Hide only hides the form, I believe you want to unload it.
    Also instead of UserForm_Activate, i think it's better to use UserForm_Initialize.

  5. #5
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Formula in cell becomes ineffective when other cells updated from userform

    OK buran,
    I will try and get back to you.

  6. #6
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Formula in cell becomes ineffective when other cells updated from userform

    OK buran,
    I will try and get back to you.

  7. #7
    Forum Contributor
    Join Date
    02-19-2013
    Location
    UK
    MS-Off Ver
    Excel 2019
    Posts
    677

    Re: Formula in cell becomes ineffective when other cells updated from userform

    Hi,
    Actually I never realised what you have explained.
    Now understood it fully.
    A great learning for me.
    Thanks again
    Kind regards

+ 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] Add date to cell when adjacent cells are updated
    By lilvictorians in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-24-2013, 07:47 PM
  2. [SOLVED] Recording updated cell values in new cells
    By Scratch2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2012, 03:08 PM
  3. Replies: 0
    Last Post: 01-23-2012, 01:55 PM
  4. Vlookup ineffective - what should I use?
    By jrchel20 in forum Excel General
    Replies: 1
    Last Post: 10-07-2011, 05:10 PM
  5. Replies: 0
    Last Post: 11-25-2005, 08:25 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