UserForm Label Caption from Cell contents

  • Thread starter Thread starter Mike Magill
  • Start date Start date
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
 
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
 
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.
 
Back
Top