pop up menu with options to select

lukas844

New Member
Joined
Jul 29, 2016
Messages
2
Dear All,

I am trying to create a macro to be with assigned to a button with my little knowledge of VBA, maybe you can give me a hand.
What I want to do with the macro once I click the button is:

- open a pop up menu containing a list of options
- user select one or more options
- specify a cell where to paste this options
- close the menu

Then I am trying to build another macro related to a second button that:

- open a pop up box
- select one or more options
- filter the table and show only rows containing selected words in a specified column.

Is it something doable or do I have to give up on this ?
Any help would be HIGHLY appreciated.

Thanks
Luca
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
This works for the first part. I created an ActiveX command button in Excel that brings up a userform with 3 checkboxes,a textbox and a command button. You enter a cell in the textbox and click the command button and it copies "option1...option3" in the cell that you specified.


Code:
Private Sub CommandButton1_Click()
UserForm1.Show


End Sub





Code:
Option Explicit
Dim ws As Worksheet


Dim tempstring As String




Private Sub CheckBox1_Click()
Set ws = Worksheets("Sheet6")
If CheckBox1.Value = True Then tempstring = "option1" & tempstring
If CheckBox1.Value = False Then tempstring = Replace(tempstring, "option1", "")
End Sub
Private Sub CheckBox2_Click()
If CheckBox2.Value = True Then tempstring = tempstring & "option2"
If CheckBox2.Value = False Then tempstring = Replace(tempstring, "option2", "")
End Sub


Private Sub CheckBox3_Click()
If CheckBox3.Value = True Then tempstring = tempstring & "option3"
If CheckBox3.Value = False Then tempstring = Replace(tempstring, "option3", "")
End Sub


Private Sub CommandButton1_Click()
Set ws = Worksheets("Sheet6")
ws.Range(Me.TextBox1).Value = tempstring




End Sub
 
Last edited:
Upvote 0
Hey thanks for your reply!
yes the first button is working but I am struggling with the second one. How do I filter by MORE than 2 words in a specified column ? My table contains more than 1 column, for now the filter gives me no result as it starts from the first column which contains only numbers and not word...

Thanks in advance for you help !
Luca


This works for the first part. I created an ActiveX command button in Excel that brings up a userform with 3 checkboxes,a textbox and a command button. You enter a cell in the textbox and click the command button and it copies "option1...option3" in the cell that you specified.


Code:
Private Sub CommandButton1_Click()
UserForm1.Show


End Sub





Code:
Option Explicit
Dim ws As Worksheet


Dim tempstring As String




Private Sub CheckBox1_Click()
Set ws = Worksheets("Sheet6")
If CheckBox1.Value = True Then tempstring = "option1" & tempstring
If CheckBox1.Value = False Then tempstring = Replace(tempstring, "option1", "")
End Sub
Private Sub CheckBox2_Click()
If CheckBox2.Value = True Then tempstring = tempstring & "option2"
If CheckBox2.Value = False Then tempstring = Replace(tempstring, "option2", "")
End Sub


Private Sub CheckBox3_Click()
If CheckBox3.Value = True Then tempstring = tempstring & "option3"
If CheckBox3.Value = False Then tempstring = Replace(tempstring, "option3", "")
End Sub


Private Sub CommandButton1_Click()
Set ws = Worksheets("Sheet6")
ws.Range(Me.TextBox1).Value = tempstring




End Sub
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top