ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Text box caption=Cell Value (without command click) (https://www.excelbanter.com/excel-programming/370934-text-box-caption%3Dcell-value-without-command-click.html)

Bafa[_5_]

Text box caption=Cell Value (without command click)
 

Private Sub CommandButton4_Click()
Label1.Caption = Worksheets("Data").Range("j20").Value
End Sub

I have this and it works, but what I am really going for is I enter
value in a text box of UserForm1 and it does a calculation and enter
the result in cell J20. When I click the command button labeled "next
it closes that user form and loads UserForm2. What I would like o
UserForm2 is to have a Label filled with the value of J20. The code
have now requires me to click a command button to have the text bo
filled with the value. I want the value filled in the text box upo
loading of the UserForm.

How can I do this. Thanks

--
Baf
-----------------------------------------------------------------------
Bafa's Profile: http://www.excelforum.com/member.php...fo&userid=3774
View this thread: http://www.excelforum.com/showthread.php?threadid=57360


Dave Peterson

Text box caption=Cell Value (without command click)
 
If you used:

Private Sub Userform_Initialize()

would that help?

Bafa wrote:

Private Sub CommandButton4_Click()
Label1.Caption = Worksheets("Data").Range("j20").Value
End Sub

I have this and it works, but what I am really going for is I enter a
value in a text box of UserForm1 and it does a calculation and enters
the result in cell J20. When I click the command button labeled "next"
it closes that user form and loads UserForm2. What I would like on
UserForm2 is to have a Label filled with the value of J20. The code I
have now requires me to click a command button to have the text box
filled with the value. I want the value filled in the text box upon
loading of the UserForm.

How can I do this. Thanks!

--
Bafa
------------------------------------------------------------------------
Bafa's Profile: http://www.excelforum.com/member.php...o&userid=37748
View this thread: http://www.excelforum.com/showthread...hreadid=573602


--

Dave Peterson

Bafa[_6_]

Text box caption=Cell Value (without command click)
 

Perfect! You see I am so new to this I didn't know I had UserForm stuf
I could set too. I've just been doing stuff with the Label, Textbox
and Command buttons. Thanks

--
Baf
-----------------------------------------------------------------------
Bafa's Profile: http://www.excelforum.com/member.php...fo&userid=3774
View this thread: http://www.excelforum.com/showthread.php?threadid=57360



All times are GMT +1. The time now is 07:03 AM.

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