+ Reply to Thread
Results 1 to 9 of 9

Need Help Clearing Textboxes

  1. #1
    Registered User
    Join Date
    08-10-2015
    Location
    Cleveland, Ohio
    MS-Off Ver
    2013
    Posts
    4

    Need Help Clearing Textboxes

    Hey everyone, so I am having issues with my userform retaining data I have already submitted. Basically I am choosing the number of hours worked in a certain center of our manufacturing plant and the macro takes those hours, plugs them into a spreadsheet, sums them, places the sum in a designated textbox in the userform, then clears the entered data in the userform.

    If I then run the macro again, even though the hours box is empty because it was cleared, it still adds the number of hours I had used the last time I ran it. If anyone has any idea why this is the case and could give me some advice on how to fix it I'd really appreciate it! Thanks in advance.

    Luke

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Need Help Clearing Textboxes

    You're not using a Public variable are you? if so, reset the variable to zero.

    Failing that, post your workbook so people can take a look.
    If someone has helped you then please add to their Reputation

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Need Help Clearing Textboxes

    Hello LukeHimes,

    To add to what pjwhitfield is saying, also check your Control Source of the TextBox.

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Registered User
    Join Date
    08-10-2015
    Location
    Cleveland, Ohio
    MS-Off Ver
    2013
    Posts
    4

    Re: Need Help Clearing Textboxes

    I do not think I have it on public. All my subs are private. And also, is my controlsource supposed to be something other then a blank?

    1.PNG2.PNG3.PNG

    The first image is of the userform with the hours I want to add to the total hours with the work schedule I want it to be added into.

    The Second is after hitting the "Set Schedule" button, where you can see the hours have been added to the textboxes below and the cells I entered have been cleared.

    The third is when I hit the "Set Schedule" button immediately again. I figured because there was nothing in any of the boxes that nothing would be added, however you can see that the numbers below have been doubled because it saved them from the last time hitting the button.

  5. #5
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Need Help Clearing Textboxes

    Its very difficult to tell from screenshots as theres so much can be going wrong, can you post the workbook?

  6. #6
    Registered User
    Join Date
    08-10-2015
    Location
    Cleveland, Ohio
    MS-Off Ver
    2013
    Posts
    4

    Re: Need Help Clearing Textboxes

    How do I post my workbook?

  7. #7
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Need Help Clearing Textboxes

    Hello LukeHimes,

    Please see below how to attach a sample workbook.

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    Regards.

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Need Help Clearing Textboxes

    Hello LukeHimes,

    Please see below how to attach a sample workbook.

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    Regards.

  9. #9
    Registered User
    Join Date
    08-10-2015
    Location
    Cleveland, Ohio
    MS-Off Ver
    2013
    Posts
    4

    Re: Need Help Clearing Textboxes

    SchedulingPride.xlsm

    Sorry for the late response, I only work Monday Wednesday Friday.

    I'm not sure how to have a before and after process show but here is the workbook. Tn the userform I want to choose a workers name, then one of his work centers, then add it to the textbox using "Monday Work Center" button, "Tuesday Work Center" button...etc.

    Then I will add hours and push "set schedule" and it will total the hours worked in that work center and put them at the bottom. The "Set Schedule" is supposed to clear just the userform but it keeps adding the previously used data even though the boxes are cleared.

+ 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: 0
    Last Post: 02-04-2015, 03:46 PM
  2. Clearing multiple textBoxes and listboxes
    By grahammal in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-09-2007, 06:31 AM
  3. Clearing A Row
    By alex1982 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2006, 11:39 AM
  4. [SOLVED] Clearing #N/A's in one go?
    By Lee Harris in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-22-2005, 02:55 PM
  5. Clearing #VALUE
    By skateblade in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-15-2005, 06:05 PM
  6. [SOLVED] Clearing of textboxes
    By CG Rosén in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-04-2005, 05:05 AM
  7. [SOLVED] Clearing text in TextBoxes
    By CG Rosén in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-18-2005, 05:05 PM

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