- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsThis is a follow up on a really cool excel technique from
http://www.experts-exchang
I have an excel parts database with 50000 records.
I defined column names of SKU, Desc, MfgSKU. (I will eventually add 15 more columns)
textboxes tbSKU and tbDesc are in row 1 of the corresponding column.
The following worksheet vba establishes tbSKU AND tbDesk as "instant zoom filters".
As I keystroke the text "cirrus hood" into tbDesc. The 50000 rows shown instantly "zoom in" to show the 100 records containing "cirrus hood". (Even with 50000 records it appears to be instantaneous! Each keystroke lowers the number of rows from 50000 to 40000 etc until only 100 records show. )
Next I keystroke 123 into tbSKU. Although tbDesc still displays "cirrus hood", that filter is dropped, so we jump to 50000 records then zoom in to the 15000 records containining 123.
I want to change the vba so that the "Cirrus hood" filter remains in place. Thus every textbox's value will be combined so the filter shows filter 1 AND filter 2 AND future filters 3 to 15.
Hope someone can help me.
Bob
P.S. If anyone is interested, I will eventually put the column names into an array, then rewritie the routine to use that array wherever possible. But the 500 points doesn't require any use of this idea.
something like
if myColumnNames is nothing then set myColumnNames = array("desc","sku", etc).
------ here is my current code ------------
Private Sub tbDesc_Change()
Call generic_change(tbDesc)
End Sub
Private Sub tbSKU_Change()
Call generic_change(tbSKU)
End Sub
Sub generic_change(tbChanged)
Dim colChanged As Range
Set colChanged = Range(Mid(tbChanged.Name, 3))
colChanged.AutoFilter Field:=1, Criteria1:="*" & tbChanged.Value & "*", VisibleDropDown:=False
If UCase(tbChanged.Value) = "" Then
ActiveSheet.AutoFilterMode
End If
End Sub
Private Sub Worksheet_SelectionChange(
Set genericColumns = Union([desc], [sku])
If Intersect(genericColumns.R
If Target.Count > 1 Then
MsgBox "Proceed at your own risk, your selection includes special search cells " _
& Intersect(genericColumns.R
Exit Sub
End If
' if user uses arrow keys to enter cell, activated the text box instead of the cell.
If Target.Column = [desc].Column Then Me.tbDesc.Activate
If Target.Column = [sku].Column Then Me.tbSKU.Activate
End Sub
This question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership