Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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
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
"Type mismatch" when I try to fill an Array variable with "+" [email protected] Excel Discussion (Misc queries) 1 April 17th 07 01:28 PM
how do I type "itis" without Excel putting a space "it is"? Max Excel Worksheet Functions 4 March 18th 07 10:22 PM
Naming cell ranges, copying formulas for a range & nesting "IF" fu DonF Excel Discussion (Misc queries) 3 October 5th 06 05:47 PM
Where is the toolbar with the "bold type", "font type", options fwccbcc New Users to Excel 2 May 3rd 06 09:11 PM


All times are GMT +1. The time now is 06:10 AM.

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"