Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
TSS
 
Posts: n/a
Default Ask user for input during marco

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   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Ask user for input during marco

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
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
Detecting when a user deletes a row Wescotte Excel Worksheet Functions 0 November 8th 05 12:01 AM
Example User Form Required robertguy Excel Discussion (Misc queries) 0 October 4th 05 02:25 PM
Cells User Select Locked after upgrade to Excel 2002 TWilson Excel Discussion (Misc queries) 1 August 5th 05 12:22 PM
Finding a record based on user input Soundman Excel Discussion (Misc queries) 5 June 21st 05 03:06 AM
excel Marco question ... need help please ALP Excel Discussion (Misc queries) 3 March 1st 05 03:11 PM


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

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"