+ Reply to Thread
Results 1 to 8 of 8

Undo last commad button

Hybrid View

slmi1313 Undo last commad button 01-28-2009, 09:52 PM
davesexcel Re: Undo last commad button 01-28-2009, 10:47 PM
slmi1313 Re: Undo last commad button 01-28-2009, 11:06 PM
davesexcel Re: Undo last commad button 01-28-2009, 11:09 PM
slmi1313 Re: Undo last commad button 01-28-2009, 11:23 PM
  1. #1
    Registered User
    Join Date
    09-13-2008
    Location
    Montreal
    MS-Off Ver
    Office XP
    Posts
    80

    Undo last commad button

    Hello All,

    I need to create an Undo Last command button.
    I have created a textbox using the control toolbox and I have created command buttons that populate text when I click them into the text box.
    Do you guys know the code for a command button to undo the last entry in the text box
    Last edited by slmi1313; 01-29-2009 at 12:03 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: Undo last commad button

    Sub Button1_Click()
        Application.Undo
    End Sub

  3. #3
    Registered User
    Join Date
    09-13-2008
    Location
    Montreal
    MS-Off Ver
    Office XP
    Posts
    80

    Re: Undo last commad button

    no that didn't work i get a debug error
    any other suggestions

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: Undo last commad button

    Quote Originally Posted by slmi1313 View Post
    no that didn't work i get a debug error
    any other suggestions
    Need more info then

  5. #5
    Registered User
    Join Date
    09-13-2008
    Location
    Montreal
    MS-Off Ver
    Office XP
    Posts
    80

    Re: Undo last commad button

    sorry ok this is the error Method"undo"of obect_'application'failed. error 1004

    My code for the command buttons are for example
    TextBox1.Value = TextBox1.Value & " check"
    TextBox1.Value = TextBox1.Value & " testing"
    so what happens is whatever is written in the text box stays and "check" is then written in the text box.

    so what I need the undo command button to do is delete the last entry in the textbox. Also the text box was created using the control toolbox. hope this helps

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: Undo last commad button

    Quote Originally Posted by slmi1313 View Post
    sorry ok this is the error Method"undo"of obect_'application'failed. error 1004

    My code for the command buttons are for example
    TextBox1.Value = TextBox1.Value & " check"
    TextBox1.Value = TextBox1.Value & " testing"
    so what happens is whatever is written in the text box stays and "check" is then written in the text box.

    so what I need the undo command button to do is delete the last entry in the textbox. Also the text box was created using the control toolbox. hope this helps
    It does not seem the Undo will work for this
    How about
    TextBox1 = ""

+ Reply to Thread

LinkBacks (?)

  1. Page
    Refback This thread
    10-04-2013, 05:47 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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