View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Koos Koos is offline
external usenet poster
 
Posts: 5
Default changing the caption of a label

Hello all,

I created a userform with a label in Excel97 SR2. After the userform is
shown I want to change it's label through my code.
Below is the code I wrote, but the label doesn't display the string I
want it to display.

Dim MyString As String
MyString = "sample text"
UserForm1.Show
UserForm1.MyLabel.Caption = MyString

When the code that tells the form to appear is positioned at the end,
the label displays the right string. But this is not what I want, the
caption of the label must be changed multiple times.

thanks in advance,
Koos