+ Reply to Thread
Results 1 to 5 of 5

clear text from textbox's

  1. #1
    Registered User
    Join Date
    11-17-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    18

    clear text from textbox's

    I have a problem with this what am I doing wrong?
    I have attached a simple example the result I was looking for was when command button is clicked the textbox would be cleared of text.
    Textbox1 = ""
    It has worked in userforms before now when I try it and have the textbox in a worksheet it doesnt seem to work?
    any ideas?
    Attached Files Attached Files

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: clear text from textbox's

    Its because you've placed the code in a code module and it doesn't know which textbox. Maybe
    Please Login or Register  to view this content.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,700

    Re: clear text from textbox's

    Because your text box is in a worksheet and not a form, you need to insert the sheet reference

    Please Login or Register  to view this content.

    Edit: got sidetracked and solus gave you the answer. Good.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    11-17-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    18

    Thumbs up Re: clear text from textbox's

    ah right got it!
    Thanks!

  5. #5
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: clear text from textbox's

    Glad to help. If you're satisfied with the solution please mark the thread as [SOLVED] using the thread tools at the top.

+ 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] How to Clear default value from Textbox on click?
    By priya06manohar@gmail in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-09-2013, 08:30 PM
  2. Replies: 0
    Last Post: 02-05-2013, 09:11 AM
  3. VBA - Macro Code to copy textbox text to another worksheet textbox
    By nitram lowm in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-05-2013, 08:39 AM
  4. [SOLVED] Clear Textbox, after clicking 2 times
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-14-2012, 06:32 PM
  5. Clear Date textbox
    By tqm1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-31-2007, 08:35 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