LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
shellshock
 
Posts: n/a
Default wildcards in vba


I have an input box where I prompt the user to enter their name.

Then, I use their name as the input for a custom filter that filters
out any rows that do not "belong" to them; this way, a massive,
intimidating spreadsheet is made to look much simpler.

This is all fine, but there are some rows that "belong" to more than
one person. What I want is to use some kind of wildcard function so
that the input to the custom filter is actually *username* instead of
just username. That way, anything that has their name in it will show
up.

Does anyone know how to do this?

This is the VBA I have so far:

Sub Filter_for_Name()

Dim UserName As String
Dim Prompt As String

Prompt = "Enter your last name"
UserName = InputBox(Prompt)

Sheets("Sheet1").Select
Selection.AutoFilter Field:=1
Selection.AutoFilter Field:=2
Selection.AutoFilter Field:=3, Criteria1:=UserName
End Sub

How do I modify this so that UserName is actually *username* instead of
just the username?


--
shellshock
------------------------------------------------------------------------
shellshock's Profile: http://www.excelforum.com/member.php...o&userid=24935
View this thread: http://www.excelforum.com/showthread...hreadid=388836

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can wildcards be used in SUMPRODUCT conditions Reed Excel Worksheet Functions 4 June 13th 05 10:06 PM
Wildcards in Functions Graeme Crook Excel Worksheet Functions 1 June 10th 05 10:42 PM
Wildcards in Functions Graeme Crook Excel Worksheet Functions 1 June 9th 05 11:31 PM
vlookup & wildcards Alex Excel Worksheet Functions 3 June 9th 05 09:41 PM
Replace using wildcards jeb Excel Discussion (Misc queries) 6 January 6th 05 03:35 PM


All times are GMT +1. The time now is 08:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"