michaelsmith559
Well-known Member
- Joined
- Oct 6, 2013
- Messages
- 881
- Office Version
- 2013
- 2007
I need help with a macro to reverse numbers in a cell. I am unsure of the best way to go about this. My first thought was a select case, but I am unsure. Here is what I am trying to do. I have a list of numbers starting in A2 and going on down the column. New data is added to the column a couple of times each week. Each number in the column is one of three lengths: 5, 6, or 7. For example: suppose A2=1003620, A3=134898, and A4=22575. I need the macro to calculate the length of the number in the cell and if it is a 5 digit number put the first two numbers to the right of the last three numbers, for a 6 digit number put the first three numbers to the right of last three numbers, and for a 7 digit number leave the first digit, but move the next three numbers to the right of the last three numbers. So using the example above the macro would change the numbers like so:
A2=1003620 To A2=1620003
A3=134898 To A3=898134
A4=22575 To A4=57522
Thanks for any help.
Mike
A2=1003620 To A2=1620003
A3=134898 To A3=898134
A4=22575 To A4=57522
Thanks for any help.
Mike