Macro to format variable amount of data

  • Thread starter Thread starter scmcrae
  • Start date Start date
S

scmcrae

What I would like to do is take a column of data of variable strin
length like this:

123
4321
54321
1234
123456
123

Format it so that each entry is seven digits and in single quote
followed by a comma like this:

'0000123',
'0004321',
'0054321',

And then put them in columns of 5 like this:

A B C...
'0000123', '0654321',
'0004321', '7654321',
'0054321', '0123456',
...

It doesn't matter what the data type is because I am using this to sor
customer numbers to paste into queries in QMF. I need them formatted i
columns because QMF will not scroll with a paste. They need leadin
zeros because the customer number data type in the table is string, s
it wants an exact match. The number of customer numbers is variable.

Any help or suggestions would be most appreciated.

Thanks
 
Back
Top