|
-
Jan 30th, 2004, 04:10 AM
#1
Thread Starter
New Member
Variable Assignment
Quick question,
I have a variable assigned as a Public integer:
Public NIG As Integer
which is assigned as an input from the user:
NIG = InputBox("Please enter the Non Investment Grade limit for filter(deafult BBB-)", "NIG Limit", 610)
I wish to use this in a logic argument:
ActiveCell.FormulaR1C1 = _
"=COUNTIF(Portfolio!R[-28]C[5]:R[591]C[5]," >= " & NIG &)/COUNT(Portfolio!R[-28]C[5]:R[591]C[5])%"
But this is returning a "TRUE" - I was expecting a percentile figure!
Any ideas?
Cheers.
-
Jan 30th, 2004, 05:14 AM
#2
Re: Variable Assignment
try formatting the cell as percentage, as "True" is just boolean for 'not-zero'.
also try removing the % at the end of the formula.
-
Jan 30th, 2004, 05:17 AM
#3
Thread Starter
New Member
Thanks for the suggestion... still giving me the same answer!!!
..really weird !
-
Jan 30th, 2004, 05:49 AM
#4
Re: Variable Assignment
ah, just realised you put the quotes in the wrong place, try this:
ActiveCell.FormulaR1C1 = _
"=COUNTIF(Portfolio!R[-28]C[5]:R[591]C[5], >= " & NIG & ")/COUNT(Portfolio!R[-28]C[5]:R[591]C[5])%"
or maybe this (if the >= clause needs to be in quotes):
ActiveCell.FormulaR1C1 = _
"=COUNTIF(Portfolio!R[-28]C[5]:R[591]C[5], "" >= " & NIG & " "")/COUNT(Portfolio!R[-28]C[5]:R[591]C[5])%"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|