I need help to understand VBA questions!

emafouanamy

New Member
Joined
Aug 24, 2014
Messages
6
Im only looking for help on a bunch of questions and I am going to be posting them one at a time upon explanation of why that is the answer. I actually want to understand the reason behind so if you can help, thank you very much?

Question 1

Given that A=12, B=13, Z=3 at the start of the following program what vale does 'A' have at the end of the program?

  • Z=(A+2) - (B+3)
  • A= A - B + (2*Z)
  • B=-B
  • A=(Z-(2*24)) * (A-B)
 
I think at this point you need to start writing the vba to achieve the outcomes.
 
Upvote 0

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
If these are questions for an Excel class I am screwed. Those two questions may as well be in a foreign language. Perhaps one of you gurus could pm me with how either of those are done I love to see it.
 
Upvote 0
Hi William
You could as I suggest to the OP, record the macro to calc the first result, using cell references as variables.....then modify the code to be a lot more efficient
the second one is in the most part written already.....just put a MsgBox after the wend for "X" to see the result
 
Last edited:
Upvote 0
okay out of my league. I will learn it when i get to it only in a intro to excel so have not got to any of this yet. I do know what an active cell and the formula bar are though :) Oh and the PMT and IF functions. I will just continue to follow and see the results if the OP posts them.
 
Upvote 0
At this point, you can walk through the code by hand.
About the loop, I think that A changes value every loop.
 
Upvote 0
Could someone tell me if I am the ballpark of the correct way to solve this?
5zD1LmZ.png
 
Upvote 0
Yep sort of.....
A hint....you keep referring to the original variables in row 2
Haven't the values of those variables changed during the calculations ???
So the variables that were originally in row2 have taken on new values ??
 
Upvote 0
So this wasn't multiple choice you had to perform a step and use the value to do the next step? Then after the final one you would have the answer?
 
Upvote 0
Well, we can't see the questions, that's just my interpretation...
How is the question framed ?
what do they ask ?
Are they dot points or one large question ?

Either way you guys have to work it out for yourselves...based on the way it was taught.
That's one of the many reasons we don't do assignments or homework !!
 
Upvote 0

Forum statistics

Threads
1,215,326
Messages
6,124,270
Members
449,149
Latest member
mwdbActuary

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top