Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Brad Sumner
 
Posts: n/a
Default Creating Custom Dialog Boxex (Popup)

Hello,
I am trying to create a custom dialog box that will allow me to have the
user clarify an entry when a checkbox is checked. I want them to be able to
select something from a list that I have created. I have created the popup
in Excel but cannot find out how to call the popup into the display when the
checkbox is checked. Can anyone help me please?
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

Is this a checkbox on the worksheet?

If yes, then if it's a checkbox from the Forms toolbar, assign this macro to the
checkbox:

Option Explicit
Sub testme()

Dim myCBX As CheckBox
Set myCBX = ActiveSheet.CheckBoxes(Application.Caller)

If myCBX.Value = xlOn Then
UserForm1.Show
End If

End Sub

If it's a checkbox from the control toolbox toolbar, then double click on that
checkbox (while in design mode) and use this kind of code:

Option Explicit
Private Sub CheckBox1_Click()
If Me.CheckBox1.Value = True Then
UserForm1.Show
End If
End Sub



Brad Sumner wrote:

Hello,
I am trying to create a custom dialog box that will allow me to have the
user clarify an entry when a checkbox is checked. I want them to be able to
select something from a list that I have created. I have created the popup
in Excel but cannot find out how to call the popup into the display when the
checkbox is checked. Can anyone help me please?


--

Dave Peterson
  #3   Report Post  
Brad Sumner
 
Posts: n/a
Default

The check box is a VB Control from the Control Toolbox. The name of the
popup is "Popup" it is a MS Excel 5.0 Dialog form. If you could help me in
explaining the code you put in some of it I understand from programming VB
but other parts of it I am not sure why it is there and all.

"Dave Peterson" wrote:

Is this a checkbox on the worksheet?

If yes, then if it's a checkbox from the Forms toolbar, assign this macro to the
checkbox:

Option Explicit
Sub testme()

Dim myCBX As CheckBox
Set myCBX = ActiveSheet.CheckBoxes(Application.Caller)

If myCBX.Value = xlOn Then
UserForm1.Show
End If

End Sub

If it's a checkbox from the control toolbox toolbar, then double click on that
checkbox (while in design mode) and use this kind of code:

Option Explicit
Private Sub CheckBox1_Click()
If Me.CheckBox1.Value = True Then
UserForm1.Show
End If
End Sub



Brad Sumner wrote:

Hello,
I am trying to create a custom dialog box that will allow me to have the
user clarify an entry when a checkbox is checked. I want them to be able to
select something from a list that I have created. I have created the popup
in Excel but cannot find out how to call the popup into the display when the
checkbox is checked. Can anyone help me please?


--

Dave Peterson

  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

Option Explicit
Private Sub CheckBox1_Click()
If Me.CheckBox1.Value = True Then
ThisWorkbook.DialogSheets("popup").Show
End If
End Sub

The checkbox control from the control toolbox toolbar has events that can be
captured. By double clicking on that checkbox, you get to the VBE and the code
window behind that worksheet.

And you get the _click event (by default).

The me. refers to the worksheet holding the checkbox.

It checks to see if the checkbox is checked. If it is, it displays the popup
dialog.



Brad Sumner wrote:

The check box is a VB Control from the Control Toolbox. The name of the
popup is "Popup" it is a MS Excel 5.0 Dialog form. If you could help me in
explaining the code you put in some of it I understand from programming VB
but other parts of it I am not sure why it is there and all.

"Dave Peterson" wrote:

Is this a checkbox on the worksheet?

If yes, then if it's a checkbox from the Forms toolbar, assign this macro to the
checkbox:

Option Explicit
Sub testme()

Dim myCBX As CheckBox
Set myCBX = ActiveSheet.CheckBoxes(Application.Caller)

If myCBX.Value = xlOn Then
UserForm1.Show
End If

End Sub

If it's a checkbox from the control toolbox toolbar, then double click on that
checkbox (while in design mode) and use this kind of code:

Option Explicit
Private Sub CheckBox1_Click()
If Me.CheckBox1.Value = True Then
UserForm1.Show
End If
End Sub



Brad Sumner wrote:

Hello,
I am trying to create a custom dialog box that will allow me to have the
user clarify an entry when a checkbox is checked. I want them to be able to
select something from a list that I have created. I have created the popup
in Excel but cannot find out how to call the popup into the display when the
checkbox is checked. Can anyone help me please?


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Brad Sumner
 
Posts: n/a
Default

Thanks for your help so far, I would ask for a little more help with
recovering the data from the popup. The popup has a listbox and the Ok and
Cancel buttons, the listbox is populated with data from a worksheet.

when I have clicked on the listbox, the field where you can name cell ranges
shows the name List Box 5. I tried to use the in the VB code and it gave
errors. I am not sure how to recover the selected item from the list.


  #6   Report Post  
Dave Peterson
 
Posts: n/a
Default

I think if you post the code, it would help.



Brad Sumner wrote:

Thanks for your help so far, I would ask for a little more help with
recovering the data from the popup. The popup has a listbox and the Ok and
Cancel buttons, the listbox is populated with data from a worksheet.

when I have clicked on the listbox, the field where you can name cell ranges
shows the name List Box 5. I tried to use the in the VB code and it gave
errors. I am not sure how to recover the selected item from the list.


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating custom list with a comma in it barnabel Excel Discussion (Misc queries) 6 January 10th 06 06:14 AM
Creating custom chart legen pallettes/styles symbols ChartDummy Charts and Charting in Excel 3 March 19th 05 03:20 AM
Creating an custom input box [email protected] Excel Worksheet Functions 1 March 17th 05 03:45 AM
Creating custom colours in Excel 2002 Fletch Excel Discussion (Misc queries) 2 March 1st 05 05:55 PM


All times are GMT +1. The time now is 11:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"