Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
InputBox or...to allow nubers formulas and Ranges I mean "Type:=0+1+8"
I Need One kind of InputBox or... 'I am Going to ask for a CHECK AMOUNT 'the User can chose betwen 'insert the amount in number 'I mean: = 150 'or CheckAmount = "=150" 'or CheckAmount = "=$C$6:$C$11" 'or CheckAmount = "=$C$6:$C$11" CheckAmount = Application.InputBox _ (Prompt:=Chr(10) & "1) Select a Range and/or insert the Full Amount!", _ Title:="http://www.developersdex.com", _ Default:="=" & Application.WorksheetFunction.Sum(Selection)) & Chr(10) & Chr(10) ', Type:=1+8) when the range is already selected this Works fine because the input Box gives me the total Amount such as 150 because: c6=30 c7=30 c8=30 c9=30 c10=30 c11=30 but if the selected cell is say A1 when the dialog box appears if I select Range("C6:C11"), the checkAmount=30 is there a solution to allow one Input Box for numbers and Ranges I mean Type=0+1+8 Many Thanks!! *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
InputBox or...to allow nubers formulas and Ranges I mean "Type:=0+1+8"
Bero,
The Type constants in Application.InputBox are not combinable. You can't specify a sum of them to allow multiple input formats. Your best bet is to allow any input an manually parse the input to ensure that it is a valid number or range. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Bero" wrote in message ... I Need One kind of InputBox or... 'I am Going to ask for a CHECK AMOUNT 'the User can chose betwen 'insert the amount in number 'I mean: = 150 'or CheckAmount = "=150" 'or CheckAmount = "=$C$6:$C$11" 'or CheckAmount = "=$C$6:$C$11" CheckAmount = Application.InputBox _ (Prompt:=Chr(10) & "1) Select a Range and/or insert the Full Amount!", _ Title:="http://www.developersdex.com", _ Default:="=" & Application.WorksheetFunction.Sum(Selection)) & Chr(10) & Chr(10) ', Type:=1+8) when the range is already selected this Works fine because the input Box gives me the total Amount such as 150 because: c6=30 c7=30 c8=30 c9=30 c10=30 c11=30 but if the selected cell is say A1 when the dialog box appears if I select Range("C6:C11"), the checkAmount=30 is there a solution to allow one Input Box for numbers and Ranges I mean Type=0+1+8 Many Thanks!! *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
"Type mismatch" when I try to fill an Array variable with "+" | Excel Discussion (Misc queries) | |||
how do I type "itis" without Excel putting a space "it is"? | Excel Worksheet Functions | |||
Naming cell ranges, copying formulas for a range & nesting "IF" fu | Excel Discussion (Misc queries) | |||
Where is the toolbar with the "bold type", "font type", options | New Users to Excel |