Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 69
Default Macro for pop up message box for auto-filter entry

Hello:

I have a spreadsheet with auto-filters. I would like to create a macro
button that works as a shortcut for those who would like to perform a certain
search function so that the users do not have to remember how to filter- all
they will need to do is enter in a series of numbers in a pop-up message box
and then hit 'ok'.

Steps are as follows:

Select auto-filter drop-down on Col. A
Select 'custom filter'
Select dropdown 'Contains'
{Enter in the string of numbers that user has entered into the popup box
into the box at right}
Select 'or' button
Select dropdown 'Equals'
{Again, enter in the string of numbers that user has entered into the popup
box into the box at right}
Hit 'Ok' button

Can you help with coding? thank you!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default Macro for pop up message box for auto-filter entry

You can enter this macro into the VBA editor, and then create a button (from
forms toolbar, or an picture from drawing toolbar) and link the macro to it.

Sub FilterChoice()

Dim Choice1 As String
Dim Choice2 As String


'Input box format is question, title
Choice1 = InputBox("What is the first string?", "First String")
Choice2 = InputBox("What is the second string?", "Second String")

'Field number equals column number, where A = 1, B = 2, etc.
Selection.AutoFilter Field:=1, Criteria1:="=*" & Choice1 & "*",
Operator:=xlOr, _
Criteria2:="=" & Choice2
End Sub


--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Roady" wrote:

Hello:

I have a spreadsheet with auto-filters. I would like to create a macro
button that works as a shortcut for those who would like to perform a certain
search function so that the users do not have to remember how to filter- all
they will need to do is enter in a series of numbers in a pop-up message box
and then hit 'ok'.

Steps are as follows:

Select auto-filter drop-down on Col. A
Select 'custom filter'
Select dropdown 'Contains'
{Enter in the string of numbers that user has entered into the popup box
into the box at right}
Select 'or' button
Select dropdown 'Equals'
{Again, enter in the string of numbers that user has entered into the popup
box into the box at right}
Hit 'Ok' button

Can you help with coding? thank you!

Reply
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
auto filter within a macro Sean Excel Discussion (Misc queries) 4 March 27th 08 11:04 AM
Auto-Filter within a Macro jeannie v Excel Discussion (Misc queries) 1 June 17th 07 10:59 AM
Auto filter run from a macro will not do the same as when done manually. ChemicalJasper Excel Discussion (Misc queries) 0 February 2nd 07 03:25 PM
Auto filter run from a macro will not do the same as when done manually. ChemicalJasper Excel Discussion (Misc queries) 0 February 2nd 07 03:25 PM
Auto Filter Macro Snakeoids Excel Discussion (Misc queries) 10 August 24th 05 08:46 PM


All times are GMT +1. The time now is 11:11 AM.

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

About Us

"It's about Microsoft Excel"