Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I create a marco for user to run a report for display any site with inventory
less than 15%, but user want to define the percentage for the site. I was able to define the box for the user input. How can I use the value to excute the marco? Here is the marco code: Sub test1() ' ' test1 Macro ' Macro recorded 11/16/2005 by County of Orange ' ' Keyboard Shortcut: Ctrl+Shift+A ' 'Get target value from user Message = "Change values less than or equal to ..." Target = InputBox(Message) Target = Val(Target) Selection.AutoFilter Selection.AutoFilter Field:=2, Criteria1:="<=15%", Operator:=xlAnd End Sub Thanks |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I think you just need
Selection.AutoFilter Field:=2, Criteria1:="<=" & Target & "%", Operator:=xlAnd assuming it is just the number input. If the % is input as well, remove it from that statement above. -- HTH RP (remove nothere from the email address if mailing direct) "TSS" wrote in message ... I create a marco for user to run a report for display any site with inventory less than 15%, but user want to define the percentage for the site. I was able to define the box for the user input. How can I use the value to excute the marco? Here is the marco code: Sub test1() ' ' test1 Macro ' Macro recorded 11/16/2005 by County of Orange ' ' Keyboard Shortcut: Ctrl+Shift+A ' 'Get target value from user Message = "Change values less than or equal to ..." Target = InputBox(Message) Target = Val(Target) Selection.AutoFilter Selection.AutoFilter Field:=2, Criteria1:="<=15%", Operator:=xlAnd End Sub Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Detecting when a user deletes a row | Excel Worksheet Functions | |||
Example User Form Required | Excel Discussion (Misc queries) | |||
Cells User Select Locked after upgrade to Excel 2002 | Excel Discussion (Misc queries) | |||
Finding a record based on user input | Excel Discussion (Misc queries) | |||
excel Marco question ... need help please | Excel Discussion (Misc queries) |