Need to make zeros

outlawspeeder

Board Regular
Joined
Jan 17, 2009
Messages
204
Office Version
  1. 2019
I am using execl to make a txt file. what I need to make is a 6 digit numer Int((100000 * Rnd) + 1) but if the number is less that 6 I need it to put zeros in front to make up the lead.

If Print #1, Int((10000 * Rnd) + 1) returns 345
I need it to Print #1, 000345

Of course execl will kill any leading zeros...

Thoughts??
 

Some videos you may like

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Watch MrExcel Video

Forum statistics

Threads
1,108,701
Messages
5,524,408
Members
409,575
Latest member
navarrov74

This Week's Hot Topics

Top