Hi Forum,
Maybe a simple question but I still need some help with a formula clarification:
Could somebody help me with this:
what is wrong?Please Login or Register to view this content.
Thanks in advance
Hi Forum,
Maybe a simple question but I still need some help with a formula clarification:
Could somebody help me with this:
what is wrong?Please Login or Register to view this content.
Thanks in advance
Last edited by alansidman; 07-09-2021 at 09:38 AM.
Judging by the ;2 at the end, I suspect you are missing a Round function somewhere.Please Login or Register to view this content.
Last edited by alansidman; 07-09-2021 at 09:38 AM.
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
Oh, and I think VBA would expect a comma rather than a semi-colon.
TMS
2, in my opinion, applies POWER.
Kaizan
You have used the sheet functions (POWER and SQRT) here as if they were VBA functions. But that's just one of the mistakes. Note that some VBA functions exclude the use of a sheet function in VBA-level calculations. This is the case with the VBA - Sqr function. You cannot use the sheet function SQRT in calculations. It is a bit different with the POWER function. You can use it in calculations, but you have to indicate that it is a sheet function (you'll see in a moment). Equivalent in VBA is sign (^), e.g.However, the use of the SQRT sheet function will fail, e.g.Please Login or Register to view this content.
you must use the VBA functionPlease Login or Register to view this content.
With this knowledge, now try to write your calculations correctly.Please Login or Register to view this content.
Artik
Last edited by Artik; 07-09-2021 at 05:58 AM.
@Artik: ah, thanks for that. POWER is not a function that I use so I couldn't see the relevance. Nor SQRT for that matter. Had worked out that it needed to be Application.WorksheetFunction.Power but was struggling with the bracketing.
OK, this compiles:
Please Login or Register to view this content.
And this compiles:
Please Login or Register to view this content.
Yes, but he asked for help and I wanted to see it corrected … even then, it might not be the calculation Kaizan wants
Last edited by TMS; 07-09-2021 at 07:59 AM. Reason: Fix typo
Hi Forum,
Thanks a lot for all the help! I am, however, having issues with the actual calculation result, which should appear in TextBox5 i have attached multiple examples on how I think this could be done.
Thanks again!
I'd create a Calculation Command Button and put your code in there.
But, as you can see, the results are zero.Please Login or Register to view this content.
Results:
Unless my maths is off, this will give you a zero value:Please Login or Register to view this content.
You can't bracket it like this:Please Login or Register to view this content.
because the multiplication would give you a minus number and Sqr won't like that.Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks