+ Reply to Thread
Results 1 to 6 of 6

previous code which written in text box

  1. #1
    Forum Contributor
    Join Date
    11-18-2014
    Location
    alex
    MS-Off Ver
    excel
    Posts
    135

    previous code which written in text box

    I want Vba code to make last code that I enter in text box appear again something like ctrl+z
    Even after I write another code in the text box

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: previous code which written in text box

    Hi sterio,

    See the file associated with post #6 in the following thread: http://www.excelforum.com/excel-prog...arameters.html

    It uses the little known and sparsely documented .Tag attribute of a UserForm Control, to store the Original Value. When you 'Double Click' a Text Box the value will toggle between the current value and the previous value.

    I hope this helps.

    Lewis

  3. #3
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: previous code which written in text box

    You can define a class object to store an array of textbox values, which update whenever a new value is entered.

    You can then choose to "undo" - revert textbox to a previous value (or even "redo").

    Here's the userform module:
    Please Login or Register  to view this content.
    And the class module:
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  4. #4
    Forum Contributor
    Join Date
    11-18-2014
    Location
    alex
    MS-Off Ver
    excel
    Posts
    135

    Re: previous code which written in text box

    I want code to command button something like below sheet when I hit command button code appear in text box 1
    Attached Files Attached Files

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: previous code which written in text box

    Your requirement is not clear. What exactly are you trying to achieve?

    The vba project in your attachment is protected, so I can't see your existing code...

  6. #6
    Forum Contributor
    Join Date
    11-18-2014
    Location
    alex
    MS-Off Ver
    excel
    Posts
    135

    Re: previous code which written in text box

    I want when I hit previous code button it make last code whichi wrote in text box 1 appear again
    Attached Files Attached Files
    Last edited by sterio; 02-14-2016 at 03:26 PM.

+ 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 use a hyperlink within the code, when the link is written in a sheet?
    By birbjo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-26-2014, 05:58 PM
  2. Making code written in 32-bit vba compatible with 64-bit vba
    By blh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-18-2014, 09:32 AM
  3. [SOLVED] Run code dependant on what is written in a cell
    By forrestgump1980 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-04-2014, 10:06 AM
  4. Same code to be written on all commandbuttons
    By Nancy123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-06-2010, 11:29 AM
  5. Dynamically/Automatically written code
    By cgi_pro in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-22-2006, 04:01 PM
  6. [SOLVED] Utility to revert accidently over written file back to previous state?
    By Nate Goulet in forum Excel General
    Replies: 3
    Last Post: 11-15-2005, 06:15 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