View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Mike Fogleman[_2_] Mike Fogleman[_2_] is offline
external usenet poster
 
Posts: 206
Default Question about input boxes

From Help:
You can use the sum of the allowable values for Type. For example, for an
input box that can accept both text and numbers, set Type to 1 + 2.

Type 0 + type 1 = 1. So should type:=1 accept both formula and number?



Mike F

"JLGWhiz" wrote in message
...
This allows a user to enter a number, but they cannot designate the
operators of < or .


Dim myNum
myNum = Application. _
InputBox("Enter a number to filter", "Number", Type:=1)
Selection.AutoFilter Field:=4, Criteria1:=myNum, Operator:=xlAnd


This will allow the user to enter a formula using the operators <, , and
=.

Dim myNum
myNum = Application. _
InputBox("Enter a number to filter", "Number", Type:=0)
Selection.AutoFilter Field:=4, Criteria1:=myNum, Operator:=xlAnd


"Rob" wrote in message
...
I know almost nothing about VBA but I pieced together a macro by copying
and
pasting. It currently has a line which applies an autofilter to sort out
any
values less than 3:
Selection.AutoFilter Field:=4, Criteria1:="=3", Operator:=xlAnd

I would like to change this from always having a criteria of 3 to
allowing
the user to input into an input box any number to filter for. Can
someone
please provide an example of how to do this?