Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
In the example nbelow the userform is opened using the workbook open event
and the userform is called with whatever caption is type in cel 1,1 of sheet 1. Private Sub Workbook_Open() UserForm1.Caption = Worksheets("Sheet1").Cells(1, 1).Text UserForm1.Show End Sub Mike " wrote: Hello all mighty Excel gurus! I was wondering if it's possible to pass a variable in when showing a userform to set the caption. I have made UserForm1 and based on a variable set earlier in the macro I want to be able to assign a "caption". Obviously I can set it in the Properties by clicking the Caption setting and typing anything I want. But can I do something like this (and pardon the "fantasy" code): Dim FormName as String FormName = Range("A1").Value UserForm.show Caption:=FormName Is something like that possible? Can I send in a predefined variable to set the caption on the fly when it opens (shows) the UserForm? Thanks! Steve |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
UserForm background was dotted, now plain? | Excel Discussion (Misc queries) | |||
Aling multiple sets of data by header column | Excel Discussion (Misc queries) | |||
Defining "Month" as a variable in VBA | Excel Discussion (Misc queries) | |||
Userform button setting variable from formula | Excel Discussion (Misc queries) | |||
Userform button setting variable from formula | Excel Discussion (Misc queries) |