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:
[TABLE="class: grid, width: 500"]
<TBODY>[TR]
[TD]Fee code
[/TD]
[TD]fee type
[/TD]
[TD]other information
[/TD]
[TD]other information
[/TD]
[TD]other information
[/TD]
[/TR]
[TR]
[TD]100
[/TD]
[TD]aaaa
[/TD]
[TD]aaaa
[/TD]
[TD]aaaa
[/TD]
[TD]aaaa
[/TD]
[/TR]
</TBODY>[/TABLE]
Example of a four of a kind fee:
[TABLE="class: grid, width: 500"]
<TBODY>[TR]
[TD]Fee code
[/TD]
[TD]fee type
[/TD]
[TD]other information
[/TD]
[TD]other information
[/TD]
[TD]other information
[/TD]
[/TR]
[TR]
[TD]101
[/TD]
[TD]abcd
[/TD]
[TD]abcd
[/TD]
[TD]abcd
[/TD]
[TD]abcd
[/TD]
[/TR]
[TR]
[TD]101
[/TD]
[TD]abbb
[/TD]
[TD]abbb
[/TD]
[TD]abbb
[/TD]
[TD]abbb
[/TD]
[/TR]
[TR]
[TD]101
[/TD]
[TD]accc
[/TD]
[TD]accc
[/TD]
[TD]accc
[/TD]
[TD]accc
[/TD]
[/TR]
[TR]
[TD]101
[/TD]
[TD]addd
[/TD]
[TD]addd
[/TD]
[TD]addd
[/TD]
[TD]addd
[/TD]
[/TR]
</TBODY>[/TABLE]
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:
[TABLE="class: grid, width: 500"]
<TBODY>[TR]
[TD]Fee code
[/TD]
[TD]fee type
[/TD]
[TD]other information
[/TD]
[TD]other information
[/TD]
[TD]other information
[/TD]
[/TR]
[TR]
[TD]100
[/TD]
[TD]aaaa
[/TD]
[TD]aaaa
[/TD]
[TD]aaaa
[/TD]
[TD]aaaa
[/TD]
[/TR]
</TBODY>[/TABLE]
Example of a four of a kind fee:
[TABLE="class: grid, width: 500"]
<TBODY>[TR]
[TD]Fee code
[/TD]
[TD]fee type
[/TD]
[TD]other information
[/TD]
[TD]other information
[/TD]
[TD]other information
[/TD]
[/TR]
[TR]
[TD]101
[/TD]
[TD]abcd
[/TD]
[TD]abcd
[/TD]
[TD]abcd
[/TD]
[TD]abcd
[/TD]
[/TR]
[TR]
[TD]101
[/TD]
[TD]abbb
[/TD]
[TD]abbb
[/TD]
[TD]abbb
[/TD]
[TD]abbb
[/TD]
[/TR]
[TR]
[TD]101
[/TD]
[TD]accc
[/TD]
[TD]accc
[/TD]
[TD]accc
[/TD]
[TD]accc
[/TD]
[/TR]
[TR]
[TD]101
[/TD]
[TD]addd
[/TD]
[TD]addd
[/TD]
[TD]addd
[/TD]
[TD]addd
[/TD]
[/TR]
</TBODY>[/TABLE]
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!