[RESOLVED] referring to userform
I created (and hid) a userform at workbook initialize. I now need a control on a worksheet to toggle the visibility of the form, but I have no way to refer to it. How do I do this?
Under workbook initialize:
dim spec as new GraphCriteria
GraphCriteria.hide()
Re: referring to userform
"Workbook_Initialize"? The only Initialize event is in a UserFOrm.
You should be able to reference the UserForm by the UserForm name and that all. No varaible needed.
Re: referring to userform
Show the code that you are using to create the userform....
Re: referring to userform
A UserForm is a UserForm, dont matter as its acessible the same.
I think maybe hes asking for what event to code the button click of a button on a sheet.
Code:
'IF ITS AN ACTIVEX BUTTON
'BEHIND SHEET1
Option Explicit
Private Sub CommandButton1_Click()
GraphCriteria.Hide
End Sub
Code:
'IF ITS A FORMS BUTTON ASSIGN THE MACRO TO THE BUTTON
'IN A STANDARD MODULE
Option Explicit
Public Sub Button1_Click()
GraphCriteria.Hide
End Sub
Re: referring to userform
Sorry--i'm behind on this thread (so many questions pop up moving to vba that books don't answer). I ditched the declaration in the workbook activation and initialized the form with GraphCriteria.Hide() (it worked). So I now refer to the userform as GraphCriteria. Thanks for your help!