Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
entering arbitrary numbers in formula to get a different answer
I have the following code to add a percentage in a formula. Cells(n, 5) = "'+6%" Cells(n, 6).FormulaR1C1 = "=.6*r[-1]c" I sometimes use different percentages such as 7 or 10 etc...so what would like to know how to do is change the 6% somehow so that I can pu in a different number when I need to so the new number will show up o the worksheet. I hope this makes sense to someone. Thank you -- pcscs ----------------------------------------------------------------------- pcscsr's Profile: http://www.excelforum.com/member.php...fo&userid=1200 View this thread: http://www.excelforum.com/showthread.php?threadid=31904 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
entering arbitrary numbers in formula to get a different answer
Is this helpful?
ans = InputBox("Please supply percentage (as n%)") If ans < "" Then With Cells(n, 5) .Value = ans .NumberFormat = "0%" End With Cells(n, 6).FormulaR1C1 = "=.6*rC[-1]" End If -- HTH RP (remove nothere from the email address if mailing direct) "pcscsr" wrote in message ... I have the following code to add a percentage in a formula. Cells(n, 5) = "'+6%" Cells(n, 6).FormulaR1C1 = "=.6*r[-1]c" I sometimes use different percentages such as 7 or 10 etc...so what I would like to know how to do is change the 6% somehow so that I can put in a different number when I need to so the new number will show up on the worksheet. I hope this makes sense to someone. Thank you. -- pcscsr ------------------------------------------------------------------------ pcscsr's Profile: http://www.excelforum.com/member.php...o&userid=12006 View this thread: http://www.excelforum.com/showthread...hreadid=319048 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
entering arbitrary numbers in formula to get a different answer
absoultely..Thank you so much..you have made my day... :) -- pcscsr ------------------------------------------------------------------------ pcscsr's Profile: http://www.excelforum.com/member.php...o&userid=12006 View this thread: http://www.excelforum.com/showthread...hreadid=319048 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
entering arbitrary numbers in formula to get a different answer
pcscsr wrote in message ...
I have the following code to add a percentage in a formula. Cells(n, 5) = "'+6%" Cells(n, 6).FormulaR1C1 = "=.6*r[-1]c" I sometimes use different percentages such as 7 or 10 etc...so what I would like to know how to do is change the 6% somehow so that I can put in a different number when I need to so the new number will show up on the worksheet. I hope this makes sense to someone. Thank you. Does this help? Sub asdf() Dim n&, s$ n = 10 Cells(n, 5).Formula = "+6%" s = Cells(n, 5).Address(, , xlR1C1) Cells(n, 6).FormulaR1C1 = "=" & s & "*r[-1]c" End End Sub Dave |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Why the arbitrary spreadsheet size limitations? | Excel Discussion (Misc queries) | |||
Entering numbers in a cel formula | Excel Discussion (Misc queries) | |||
Entering numbers in a cel formula | Excel Worksheet Functions | |||
how do you get # value returned by entering: =4^3 (answer 64)??? | Excel Discussion (Misc queries) | |||
Formula without using numbers after decimal in the answer | Excel Discussion (Misc queries) |