Introducing User-specified series

Ealglez

New Member
Joined
Mar 13, 2015
Messages
28
Dear all,

I would like to insert the following function in my VBA, but I have no idea if it is even possible, since I just started with VBA.

I would like to prompt a message box (or similar) so that the user could insert the "Initial number", the "final number" and the "step". Then, the VBA code will calculate all the numbers in the series and use each one individually to calculate something else. This will be cell B2 * the number.

Example:

In active worksheet, range A1:L3 is populated. Important cells are B2, D2.
Then the window will pop up and the user will insert:
-"Initial number" = 120
-"Final number" = 150
- Step = 5
So the number of "numbers" will be 7 (120, 125, 130, 135, 140, 145, 150).
Error message if number of "number" is >13 (calculation restrictions).

The VBA code will do a loop from i=1 to number of "numbers"
doing B2*i and D2*i

Any help will be much appreciated!!

Thank you in advance!
E
 

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