HakanNedjat
New Member
- Joined
- Jan 23, 2014
- Messages
- 10
Hi all,
New to the forum, found it extremely helpful with my situations so far but I cannot seem to find an answer for my most recent problem.
I am trying to create a form for a client that build up a list of parts needed based on what optional extras they choose (using option buttons).
The list starts with all of the parts if every option was chosen but then is filtered down to the basic starting point, from here I want to then select certain criteria as each option is selected, keeping the existing choices unfiltered and adding to the list.
Here's what code I have so far:
Private Sub OptionButton5_Click()
Rows("13:40").Select
Selection.EntireRow.Hidden = False
Sheets("Build Sheet").Select
ActiveSheet.Range("$B$3:$I$101").AutoFilter Field:=1, Criteria1:="=RW480"
ActiveSheet.Range("$B$3:$I$101").AutoFilter Field:=2, Criteria1:="=Hull"
Sheets("Quote").Select
ActiveSheet.Range("C14").Select
ActiveCell.FormulaR1C1 = "='Spec up boat'!R[-6]C[-1]"
Sheets("Spec up boat").Select
ActiveSheet.Range("A1").Select
End Sub
Private Sub OptionButton11_Click()
Sheets("Build Sheet").Select
ActiveSheet.Range("$B$3:$I$103").AutoFilter Field:=2, Criteria1:= _
"=6mm Bottom"
Sheets("Spec up boat").Select
Range("A1").Select
End Sub
The problem is when I select "optionbutton11" it gets rid of the criteria from "optionbutton5".
Is there a way of writing the code so it does not get rid of any criteria already chosen? Just adds to it?
Thanks for your help.
Hakan
New to the forum, found it extremely helpful with my situations so far but I cannot seem to find an answer for my most recent problem.
I am trying to create a form for a client that build up a list of parts needed based on what optional extras they choose (using option buttons).
The list starts with all of the parts if every option was chosen but then is filtered down to the basic starting point, from here I want to then select certain criteria as each option is selected, keeping the existing choices unfiltered and adding to the list.
Here's what code I have so far:
Private Sub OptionButton5_Click()
Rows("13:40").Select
Selection.EntireRow.Hidden = False
Sheets("Build Sheet").Select
ActiveSheet.Range("$B$3:$I$101").AutoFilter Field:=1, Criteria1:="=RW480"
ActiveSheet.Range("$B$3:$I$101").AutoFilter Field:=2, Criteria1:="=Hull"
Sheets("Quote").Select
ActiveSheet.Range("C14").Select
ActiveCell.FormulaR1C1 = "='Spec up boat'!R[-6]C[-1]"
Sheets("Spec up boat").Select
ActiveSheet.Range("A1").Select
End Sub
Private Sub OptionButton11_Click()
Sheets("Build Sheet").Select
ActiveSheet.Range("$B$3:$I$103").AutoFilter Field:=2, Criteria1:= _
"=6mm Bottom"
Sheets("Spec up boat").Select
Range("A1").Select
End Sub
The problem is when I select "optionbutton11" it gets rid of the criteria from "optionbutton5".
Is there a way of writing the code so it does not get rid of any criteria already chosen? Just adds to it?
Thanks for your help.
Hakan