I am looking for a way to use the value in a cell as a caption on a user form. Any help would be appreciated.
I am looking for a way to use the value in a cell as a caption on a user form. Any help would be appreciated.
Something like this?
![]()
UserForm1.Caption = Worksheets("Sheet1").Range("A1").Value
If posting code please use code tags, see here.
Thanks, but where would I put that code? and if I name that cell could I save some typing?
In the form's Initialize event perhaps.
You could name the cell if you wanted and it would save a few keystrokes.![]()
Private Sub UserForm_Initialize() UserForm1.Caption = Worksheets("Sheet1").Range("A1").Value End Sub
Norie, Thanks for the help and this is what I have written.
addplayerf = form
asquare = name of the label in addplayerf form I am trying to get to change
sasquarename = named cell I am trying to reference
![]()
Private Sub addplayerf_Initialize() asquare.Caption = "sasquare" End Sub
Last edited by Chillywilly76; 02-05-2013 at 04:11 PM. Reason: correction
Don't change Userform_Initialize.
If 'sasquare' is a named range you need Range("sasquare"l.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks