+ Reply to Thread
Results 1 to 8 of 8

Delete selected text from a text box on a Userform

  1. #1
    Registered User
    Join Date
    11-01-2013
    Location
    Essex UK
    MS-Off Ver
    Excel 2003
    Posts
    95

    Delete selected text from a text box on a Userform

    I need a bit of simple code to delete just the text I have selected in a textbox.

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Delete selected text from a text box on a Userform

    Maybe :
    Please Login or Register  to view this content.
    Attached Files Attached Files
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Registered User
    Join Date
    11-01-2013
    Location
    Essex UK
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: Delete selected text from a text box on a Userform

    Thanks Caredog.
    I could never make TextBox1.SelText = "" work.
    But your example workbook works fine so I'll attempt to adapt it and come back with the result.

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Delete selected text from a text box on a Userform

    You are welcome donwb.

    The code should be put in Userform's module (not in standard module e.g. module1 etc), and in case you rename the textbox control to something else (e.g. TxtInput), you also should change the code to reflect this, like :
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-01-2013
    Location
    Essex UK
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: Delete selected text from a text box on a Userform

    Many thanks Karedog
    I forgot the golden rule - my code was in a standard module, not the User Form one.
    Problem solved

  6. #6
    Registered User
    Join Date
    11-01-2013
    Location
    Essex UK
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: Delete selected text from a text box on a Userform

    If I could see how to mark this Thread as solved / closed, I would.

  7. #7
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Delete selected text from a text box on a Userform

    You are welcome, to mark this thread as solved :

    select Thread Tools from the menu link above and mark this thread as SOLVED.

    Regards

  8. #8
    Registered User
    Join Date
    11-01-2013
    Location
    Essex UK
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: Delete selected text from a text box on a Userform

    Thank you Karedog

+ 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] Delete red text within selected cells and add space if there isn't one
    By Dunno123 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-07-2020, 05:25 AM
  2. [SOLVED] Replace and delete certain text in the selected cells
    By Dunno123 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-06-2020, 06:37 PM
  3. [SOLVED] If userform text box is not selected, do nothing on control click
    By Un-Do Re-Do in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-12-2018, 10:49 AM
  4. [SOLVED] VBA - delete text b/w first and second space in a string of text - apply to selected range
    By mgerner in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-16-2018, 03:52 PM
  5. [SOLVED] userform auto populate text boxes once combo box has been selected
    By kanew7869 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-11-2016, 10:24 AM
  6. find text in listbox on userform, delete row containing that text on spreadsheet
    By tsiguy96 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-09-2016, 03:11 AM
  7. [SOLVED] Userform add text when duplicate values are selected matching data criteria
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-11-2014, 10:22 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