+ Reply to Thread
Results 1 to 4 of 4

VBA Not Accepting Changes

  1. #1
    Registered User
    Join Date
    08-11-2012
    Location
    canada
    MS-Off Ver
    365
    Posts
    14

    VBA Not Accepting Changes

    Hello again,

    I have a button on a userform that will generate certain text in a combo box.
    The combobox then goes to a worksheet.
    If I select a second button, I want the first information on the worksheet to clear and accept the new information from the next button.

    NOTE: I have it as a combobox so I can either select it from the combobox or click the button. When I select the information from the combobox, it does clear out everything automatically.

    Here is my code:

    Private Sub CommandButton2_Click()

    Worksheets("score").Range("B6").ClearContents
    ComboBox1.Text = ComboBox1.Text + "PASS"
    Worksheets("score").Range("b6") = Me.ComboBox1.Value
    TextBox2.SetFocus

    End Sub


    What I think I am doing is clearing the cell, entering my text then going to the next text box, but when I click the second button (same code, text is "FAIL"), I then get "PASSFAIL" in cell B6.
    I want it to clear out the previous entry and only use the new one, but it keeps all that I click even though I said to clear the contents.

    Any thoughts??

    Thanks in advance for your help.
    Last edited by weebo35; 05-03-2014 at 02:05 PM.

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: VBA Not Accepting Changes

    Please Login or Register  to view this content.
    try above

    combobox aleardy have some value and you are supplying another text with that value that may be a issue.


    *Myself learning VBA now.
    Last edited by hemesh; 05-03-2014 at 02:04 PM.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Registered User
    Join Date
    08-11-2012
    Location
    canada
    MS-Off Ver
    365
    Posts
    14

    Re: VBA Not Accepting Changes

    That's it!!!
    Just needed another set of eyes. Smart eyes!!!

    Thank you.
    Have a great day.

  4. #4
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: VBA Not Accepting Changes

    Glad I could help. If your query is solved please mark the thread as solved.

+ 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. IF formula not accepting 1?
    By JonathanB2 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-02-2014, 10:19 AM
  2. Cells not accepting format
    By FashionablyDoomed in forum Excel General
    Replies: 0
    Last Post: 08-15-2011, 12:25 PM
  3. Accepting input from user
    By Christol in forum Excel General
    Replies: 1
    Last Post: 05-03-2011, 06:40 AM
  4. vba not accepting the symbol <
    By smithy_o7 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 06-29-2010, 08:33 AM
  5. textbox not accepting given values.
    By D_Rennie in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 10-26-2009, 05:30 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