ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Label caption on loading a userfform (https://www.excelbanter.com/excel-programming/309196-label-caption-loading-userfform.html)

ecando[_3_]

Label caption on loading a userfform
 
Hi,
How can I update a label caption (froma cell range) upon loading a use
form? I can get it to happen with a button click, but want it to get th
values from a cell ... and cann't?
If you can help, that'd be great !
:

--
Message posted from http://www.ExcelForum.com


mangesh_yadav[_102_]

Label caption on loading a userfform
 
in the Sub UserForm_Initialize(), put a line
label.caption = worksheets("Sheet1").range("A1").value
A1 in sheet1 contains the value for the label caption

Manges

--
Message posted from http://www.ExcelForum.com


ecando[_4_]

Label caption on loading a userfform
 
mangesh_yadav wrote:
*in the Sub UserForm_Initialize *


Thanks Mangesh ... VERY new to this... not sure about the above .. bu
will try and figure it out.....
:

--
Message posted from http://www.ExcelForum.com


mangesh_yadav[_106_]

Label caption on loading a userfform
 
in the design view, double click on the form. You will enter the mode
where you have to enter the code. Place the following code there
Private Sub UserForm_Initialize()
button_name.caption = worksheets("Sheet1").range"A1").value
End Sub

mangesh


---
Message posted from http://www.ExcelForum.com/


ecando[_5_]

Label caption on loading a userfform
 
mangesh_yadav wrote:
*in the design view, double click on the form. You will enter th
mode where you have to enter the code. *


THAT'S what I wasn't doing .... now works perfectly.

THANKS VERY MUCH

:cool: :) :

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 05:11 AM.

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