Take a sting and set it as text in a userform label

R

RoVo

Hello,
I was wondering if there is a way in VBA to take a string set it as
the text in a label for a userform rather than use the IDE to enter it
through the properties window. To be more specific, I am reading cells
from a Word Table and storing them as strings, then the user gets a
list of the cells contents in the userform presented as labels next to
checkboxes. Thanks in advance for any help you can send my way.

Rob
 
G

Greg Maxey

Rob,

You could use the UserForm Initialize event and set the value of the
label caption to a table cell text. E.g.,

Private Sub UserForm_Initialize()
Me.Label1.Caption = ActiveDocument.Tables(1).Cell(1, 1).Range.Text
End Sub
 

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