Userform

S

Sandy

I have created a userform:- name = frmWelcome. On the form I have a
checkbox:- name = cbNoView. The form contains information concerning the
workbook.

What I am trying to do is to have the form open with excel but should the
user not want to see it again then tick the check box, and it will not open
again.

Can anyone point me in the right direction as to the code requirement and
where it would be placed.

Excel 2003

Sandy
 
S

Sam Wilson

You could have a sheet in the workbook, and set that sheet's visibility to
very hidden, and then have the event record a 1 in cell A1 on this sheet if
the checkbox is ticked.

Then you just need to add an if statement before frmWelcome.show in your
workbook open event.

Sam
 
D

dqsp

I use this code in combination with a registry-key (user-part)

*************
' Show About screen
If GetSetting(appname:="YourExcelSheetName", Section:="About", _
Key:="Aboutscreen") = "" Then GoTo Next2do1
If GetSetting(appname:="YourExcelSheetName", Section:="About", _
Key:="Aboutscreen") = True Then GoTo Next2do2

Next2do1:
UserForm1.Show

Next2do2:
********
Hope this helps
Rob
 
D

dqsp

I use this code in combination with a registry-key (user-part)

*************
'   Show About screen
    If GetSetting(appname:="YourExcelSheetName", Section:="About",_
      Key:="Aboutscreen") = "" Then GoTo Next2do1
    If GetSetting(appname:="YourExcelSheetName", Section:="About",_
      Key:="Aboutscreen") = True Then GoTo Next2do2

Next2do1:
    UserForm1.Show

Next2do2:
********
Hope this helps
Rob

The procedure is part of a workbook_open event
What I forgot:
Of course when ticking the checkbox you need the code to write in the
registry.
The code is:
Private Sub cbNoView_Click()
' Information is written in
' HKEY_CURRENT_USER/Software/VB and VBA Program Settings/
YourExcelSheetName
' Section About
' Key AboutScreen
SaveSetting appname:="YourExcelSheetName", Section:="About", _
Key:="AboutScreen", setting:=cbNoView.Value
End Sub
 
S

Sandy

Very simple and works a treat
Thank you
Sandy

Sam Wilson said:
You could have a sheet in the workbook, and set that sheet's visibility to
very hidden, and then have the event record a 1 in cell A1 on this sheet
if
the checkbox is ticked.

Then you just need to add an if statement before frmWelcome.show in your
workbook open event.

Sam
 
S

Sam Wilson

Can you mark it as the answer, in case someone else searches for a similar
problem?

Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top