Label caption on loading a userfform

  • Thread starter Thread starter ecando
  • Start date Start date
E

ecando

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 !
:
 
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
 
mangesh_yadav said:
*in the Sub UserForm_Initialize *

Thanks Mangesh ... VERY new to this... not sure about the above .. bu
will try and figure it out.....
:
 
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
 
mangesh_yadav said:
*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: :) :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top