ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Text box last entry (https://www.excelbanter.com/excel-programming/420418-text-box-last-entry.html)

Art

Text box last entry
 
Hello:

How can I make that a textbox in a userform should remember the users entry
even when it was unloaded already?

Thanks
Art

Simon Lloyd[_933_]

Text box last entry
 

You need to assign a public variable on a standard module and have that
variable equal the textbox, when the userform is unloaded the public
variable unless set to nothing will be the last value of the textbox.


--
Simon Lloyd

Regards,
Simon Lloyd
'www.thecodecage.com' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=32986


Mike H

Text box last entry
 
Hi,

You could capture the value when the iserform closes and store it and then
re-load the value when the userform next loads.

Private Sub UserForm_Activate()
TextBox1.Text = Sheets("Sheet1").Range("A1").Value
End Sub

Private Sub UserForm_Terminate()
Sheets("Sheet1").Range("A1").Value = TextBox1.Text
End Sub

Mike

"art" wrote:

Hello:

How can I make that a textbox in a userform should remember the users entry
even when it was unloaded already?

Thanks
Art



All times are GMT +1. The time now is 01:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com