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
 

Some videos you may like

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Watch MrExcel Video

Forum statistics

Threads
1,099,078
Messages
5,466,484
Members
406,484
Latest member
kaksolver

This Week's Hot Topics

Top