UserForm Label Caption from Cell contents

M

Mike Magill

Hi,

I'm trying to create a UserForm that amongst other things shows the
contents of a cell (H3) on a worksheet (Risk Register) in a label when
the UserForm is shown.

My searching online suggests the following code should work but it
doesn't for me. The label is simply blank. What am I doing wrong?

Thanks,

Mike

Private Sub UserForm2_Initialize()
Label4.Caption = Worksheets("Risk Register").Range("H3").Value
End Sub
 
P

Per Jessen

Hi Mike,

The macro will never fire, as first line should not have the name of the
userform just 'UserForm_Initialize' as it is always refering to the userform
where it is.

So just remove the figure 2 from first line and you are going.

Regards,
Per
 
M

Mike Magill

Hi Mike,

The macro will never fire, as first line should not have the name of the
userform just 'UserForm_Initialize' as it is always refering to the userform
where it is.

So just remove the figure 2 from first line and you are going.

Regards,
Per

"Mike Magill" <[email protected]> skrev i meddelelsen





- Show quoted text -

Thank you so much.
 

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

Top