Results 1 to 2 of 2

Thread: VBA Code for User Form

  1. #1
    Junior Member
    Join Date
    Dec 2014
    Posts
    4
    Rep Power
    0

    VBA Code for User Form

    I need help with setting up user form properties. I have calendar form and when I set properties form initializes just fine showing Month and Year as a title, drop down menus for Month and Year, day names and day numbers...all in font and color I have set using properties function. However, as soon as I move doc to another PC calendar initializes without Title, drop menus for year and month and looses font, its color and background color I have previously set before moving doc to another machine. My question is, is there vba code I can set this properties when form initialized...or even maybe on Workbook Open...?

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,122
    Rep Power
    10
    yes, you can. For example...

    Code:
    Private Sub UserForm_Initialize()
        
        Me.TextBox1.Font.Size = [A1].Font.Size
        Me.TextBox1.BackColor = [A1].Interior.Color
        Me.TextBox1.ForeColor = [A1].Font.Color
    
    End Sub
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

Similar Threads

  1. Inserting Image In VBA User Form Caption
    By littleiitin in forum Download Center
    Replies: 3
    Last Post: 02-22-2021, 03:07 PM
  2. Replies: 5
    Last Post: 06-13-2014, 08:37 PM
  3. Replies: 2
    Last Post: 11-02-2013, 04:17 PM
  4. Sending Data From User Form To First Empty Row Of Sheets
    By paul_pearson in forum Excel Help
    Replies: 21
    Last Post: 08-14-2013, 11:04 PM
  5. Adding A Menu Bar To A User Form
    By Rasm in forum Excel Help
    Replies: 14
    Last Post: 05-05-2011, 04:05 AM

Posting Permissions

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