+ Reply to Thread
Results 1 to 6 of 6

User Form Captions

Hybrid View

Chillywilly76 User Form Captions 02-05-2013, 02:23 PM
Norie Re: User Form Captions 02-05-2013, 02:32 PM
Chillywilly76 Re: User Form Captions 02-05-2013, 02:38 PM
Norie Re: User Form Captions 02-05-2013, 02:52 PM
Chillywilly76 Re: User Form Captions 02-05-2013, 04:09 PM
Norie Don't change... 02-05-2013, 04:24 PM
  1. #1
    Registered User
    Join Date
    02-05-2013
    Location
    Peoria, IL
    MS-Off Ver
    Excel 2007
    Posts
    3

    User Form Captions

    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.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: User Form Captions

    Something like this?
    UserForm1.Caption = Worksheets("Sheet1").Range("A1").Value
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    02-05-2013
    Location
    Peoria, IL
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: User Form Captions

    Thanks, but where would I put that code? and if I name that cell could I save some typing?

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: User Form Captions

    In the form's Initialize event perhaps.
    Private Sub UserForm_Initialize()  
       UserForm1.Caption = Worksheets("Sheet1").Range("A1").Value
    End Sub
    You could name the cell if you wanted and it would save a few keystrokes.

  5. #5
    Registered User
    Join Date
    02-05-2013
    Location
    Peoria, IL
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: User Form Captions

    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

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646
    Don't change Userform_Initialize.

    If 'sasquare' is a named range you need Range("sasquare"l.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1