smileypkr
Replies to this thread:
More by smileypkr
What people are reading
Subscribers
Please log in to subscribe to smileypkr's postings.
:: Subscribe
|
VBA code to calculate one number raised to the power another number i.e x to the power n
|
[VIEWED 12505
TIMES]
|
SAVE! for ease of future access.
|
|
|
|
smileypkr
Please log in to subscribe to smileypkr's postings.
Posted on 09-29-09 12:24
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
| |
|
|
| |
|
|
|
|
techGuy
Please log in to subscribe to techGuy's postings.
Posted on 09-29-09 1:09
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
| |
http://www.excelfunctions.net/VBA-Operators-And-Functions.html | Operator | Action | Precedence (1=top; 5=bottom) | ^ | The power operator | 1 | * | The multiplication operator | 2 | / | The division operator | 2 | \ | The integer division operator - this operator divides two numbers and returns the integer result (eg. 7\4 gives a result of 1) | 3 | Mod | The modulus operator - this operator divides two numbers and returns the remainder (eg. 8 Mod 3 gives a result of 2) | 4 | + | The addition operator | 5 | - | The subtraction operator | 5 |
|
| |
|
|
xcopsgen
Please log in to subscribe to xcopsgen's postings.
Posted on 09-29-09 3:40
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
| |
Private Sub Power() Dim val1 as double; //val1 is x Dim val2 as double; //val2 is n Dim val3 as double; //val3 to store result val3 = val1 ^ val2; //val3 will have the result End Sub
|
| |
|
|
shivanagar
Please log in to subscribe to shivanagar's postings.
Posted on 09-29-09 5:08
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
| |
scopsgen, U might want to declare the power as function taking two parameters val1, val2 and returning val3, the code is not of any use if you can not give argument or get value. right?? smileypkr, Why do you need VBA for power, you have power function in Excel right, but if you want to use this in code makes sense, but you can always access inbuil power function using worksheetfunction property such as =Application.WorksheetFunction.Power(x,y)
|
| |
Please Log in! to be able to reply! If you don't have a login, please register here.
YOU CAN ALSO
IN ORDER TO POST!
Within last 200 days
| Recommended Popular Threads |
Controvertial Threads |
| NRN card pros and cons? |
| ANA and AJAY KUMAR DEV. RAPISTS CONVENTION |
| legal Query for married nepali girl now have taken US citizenship |
| Democrat wants to run election like in India. Chaos and Confusing to voters. |
| 2020 : Why No Trump ! |
| Breaking News: Ninth Circuit Rejects Government Bid to Undo Nepal TPS Order, Leaves Protections in Place |
| ए १ पनि पुगेनछ ? |
| नोबेल शान्ति पुरस्कार र अशान्त राष्ट्रपतिको बालहठ |
| 200 denaturalization cases per month to the Department of Justice for the 2026 fiscal year. |
| ALERT: JUDGE RULED NEPAL TPS CAN CONTINUE |
| BREAKING: FEDERAL JUDGE ORDERS TRUMP ADMINISTRATION TO DELAY TERMINATION OF TPS HUMANITARIAN PROTECTION FOR 60,000 TPS HOLDERS WHO HAVE LIVED IN THE US FOR YEARS |
| नेपाली वालमार्ट चोर |
| मानसिक सन्तुलन, एक कहालीलाग्दो घटना सिक्नुपर्ने कुराहरु |
| H1B |
| Funny when Nepalis talk about Epstein and injustice |
| मिरो प्रेडिक्शन जन्मेर एमेरिकामा आखा खो ल न पायेका नागरिकता बारे |
| बालेंन आए पछि आशाका किरण देखिन थालेका छन् !! |
| EAD Filing |
| Tps decision coming or not nov 18 |
| Why Oli must go for the UML to survive? |
|
|
NOTE: The opinions
here represent the opinions of the individual posters, and not of Sajha.com.
It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address
if you want any posting to be considered for deletion. Your request will be
handled on a one to one basis. Sajha.com is a service please don't abuse it.
- Thanks.
|