PDA

View Full Version : I need help with creating a Macro!!



ttribby
01-24-2013, 01:23 PM
I have an excel sheet where in cell A1 I have a number. Let’s say the number is 5000. I would like to have a macro that no matter what number I put into cell A1, another column will list the number 400 for however many times you can get 400 from the number in cell A1. Depending on the number in cell A1 you may or may not end up with zero or you could have a remainder. This is driving me crazy!!! :banghead: Help!!Example:5000400400400400400400400400400400400400200

Kenneth Hobs
01-24-2013, 01:50 PM
Welcome to the forum!

Use Mod.

ttribby
01-24-2013, 01:55 PM
use Mod??

Kenneth Hobs
01-24-2013, 02:16 PM
Type the word Mod in the VBE and press the F1 key in or near the word or
look through help to find out how to use it. e.g.


msgbox 5000 mod 400

Teeroy
01-24-2013, 02:26 PM
You don't need a macro for this. If your number is in A1 use the formula

=REPT("400",INT(A1/400))&MOD(A1,400)