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
 

mrCostas

New Member
Joined
Jul 27, 2016
Messages
18
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:

lukas844

New Member
Joined
Jul 29, 2016
Messages
2
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
 

Forum statistics

Threads
1,082,133
Messages
5,363,341
Members
400,729
Latest member
Lisa McConachy

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top