Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default Custom Filter in a Macro

I would like the Macro to prompt the user for what they want to see within
the filter; the user input will vary. What's the "prompt user" code?

Another question - I want to print the results which could vary in number of
rows - can a Macro accommodate that? How so?

Thank you in advance for your time and consideration.

Regards,
Mike

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,805
Default Custom Filter in a Macro

1. Search Help for INPUTBOX

Following is the example from Help
Dim Message, Title, Default, MyValue
Message = "Enter a value between 1 and 3" ' Set prompt.
Title = "InputBox Demo" ' Set title.
Default = "1" ' Set default.
' Display message, title, and default value.
MyValue = InputBox(Message, Title, Default)

' Use Helpfile and context. The Help button is added automatically.
MyValue = InputBox(Message, Title, , , , "DEMO.HLP", 10)

' Display dialog box at position 100, 100.
MyValue = InputBox(Message, Title, Default, 100, 100)

2. You can set the print area through code like the example below (again
from Help);
ActiveSheet.PageSetup.PrintArea = _
ActiveCell.CurrentRegion.Address

"Mike The Newb" wrote:

I would like the Macro to prompt the user for what they want to see within
the filter; the user input will vary. What's the "prompt user" code?

Another question - I want to print the results which could vary in number of
rows - can a Macro accommodate that? How so?

Thank you in advance for your time and consideration.

Regards,
Mike

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default Custom Filter in a Macro

I'm sorry, I do not understand this - I'm a Newb.

I record Macros manually, I do not write VB Script. My simple Macro looks
like this:
Selection.AutoFilter Field:=1, Criteria1:="=7777", Operator:=xlAnd
End Sub

I need the criteria1 to be variable (as apposed to always 7777) as input by
the user when prompted after kicking off the macro.

Regards,
Mike

"Sheeloo" wrote:

1. Search Help for INPUTBOX

Following is the example from Help
Dim Message, Title, Default, MyValue
Message = "Enter a value between 1 and 3" ' Set prompt.
Title = "InputBox Demo" ' Set title.
Default = "1" ' Set default.
' Display message, title, and default value.
MyValue = InputBox(Message, Title, Default)

' Use Helpfile and context. The Help button is added automatically.
MyValue = InputBox(Message, Title, , , , "DEMO.HLP", 10)

' Display dialog box at position 100, 100.
MyValue = InputBox(Message, Title, Default, 100, 100)

2. You can set the print area through code like the example below (again
from Help);
ActiveSheet.PageSetup.PrintArea = _
ActiveCell.CurrentRegion.Address

"Mike The Newb" wrote:

I would like the Macro to prompt the user for what they want to see within
the filter; the user input will vary. What's the "prompt user" code?

Another question - I want to print the results which could vary in number of
rows - can a Macro accommodate that? How so?

Thank you in advance for your time and consideration.

Regards,
Mike

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
Use the custom filter dialog in a macro KenInPortland Excel Worksheet Functions 3 August 16th 08 03:11 AM
2003 - 2007 custom macro and custom button restore. Scott Sornberger Excel Discussion (Misc queries) 11 May 23rd 08 02:41 PM
Macro to copy and paste into a custom filter Jtmturner Excel Discussion (Misc queries) 6 February 1st 07 07:14 PM
Custom Filter Shams Excel Worksheet Functions 4 July 11th 06 08:36 PM
Custom Filter Rao Ratan Singh New Users to Excel 3 June 16th 06 01:36 PM


All times are GMT +1. The time now is 04:30 PM.

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"