PDA

View Full Version : VBA Code for User Form



dkesar
01-02-2015, 11:37 AM
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...?

Admin
01-02-2015, 03:19 PM
yes, you can. For example...


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