jamespryor
New Member
- Joined
- Aug 7, 2014
- Messages
- 2
So I have created a spreadsheet where team members can click a button, type in a number, such as 999 into a user form and it will search another sheet that is set up as a table and has an autofilter. I am running into issues with users searching for something that is only one of a kind and then users searching for something that is four of a kind and it only displaying one result.
Example of a one of a kind fee:
<TBODY>
</TBODY>
Example of a four of a kind fee:
<TBODY>
</TBODY>
So like I mentioned above if they search the 100 code first it would be fine, but if they then go and search the 101 it would only display the 101/abcd. If the 101 is the first thing they search when they open the sheet everything works fine.
This is the code on the search button of the userform:
Thank you in advance if you know anyway to help me with this issue!
Example of a one of a kind fee:
Fee code | fee type | other information | other information | other information |
100 | aaaa | aaaa | aaaa | aaaa |
<TBODY>
</TBODY>
Example of a four of a kind fee:
Fee code | fee type | other information | other information | other information |
101 | abcd | abcd | abcd | abcd |
101 | abbb | abbb | abbb | abbb |
101 | accc | accc | accc | accc |
101 | addd | addd | addd | addd |
<TBODY>
</TBODY>
So like I mentioned above if they search the 100 code first it would be fine, but if they then go and search the 101 it would only display the 101/abcd. If the 101 is the first thing they search when they open the sheet everything works fine.
This is the code on the search button of the userform:
Code:
Private Sub SearchButton_Click()
Range("T6:X11").Clear
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=1, Criteria1:=FeeTextBox.Value
Range("A3:L57").Select
Selection.Copy
Selection.Name = "ShowFeeInfo"
Range("RowSourceRange").Select
ActiveSheet.PasteSpecial
Application.CutCopyMode = False
Unload Me
'centers the userform if they are using two monitors
With ResultForm1
.StartUpPosition = 0
.Left = Application.Left + (0.5 * Application.Width) - (0.5 * .Width)
.Top = Application.Top + (0.5 * Application.Height) - (0.5 * .Height)
.Show
End With
End Sub
Thank you in advance if you know anyway to help me with this issue!