Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro Needed to Manipulate Numbers

Status
Not open for further replies.

mkuethe

Technical User
Jul 19, 2001
25
0
0
US
I've been struggling with this for a while and desperately need someone's help. I need a macro that will take a 13 digit number, add a zero at the front, change the place of the 9th and 10th digit and then add two more zeros at the end.

For instance:

Take 08347004003486 in Column A and change it to 00834700434008600 in Column B.

Steps:

Add a zero at the front: 008347004003486.

Move the 9th and 10th digits in Column A to the 12th and 13th spots in Column B: 08347004003486 becomes 008347004340086.

Add two zeros at the end: 00834700430048600.

Finally, move to the next row (A2) and repeat these steps - so on an so forth until the end of the numbers in Column A.
________________

If anyone can help me with this, it would be greatly appreciated!!!
 
why a macro; why not a formula?

=0&LEFT(A1,8)&"00"&RIGHT(A1,4)

--Lilliabeth
 
one more try I misunderstood the question.

=0&LEFT(A8,8)&MID(A8,11,2)&MID(A8,9,2)&RIGHT(A8,2)&"00"

--Lilliabeth
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top