Loop

K

kevcar40

Hi
I have a column of numbers
column N Holds the Numbers
some of the numbers are 1 digit, some 2 digits
some 6 digits and some 7 digits
What i would like to do is :-
loop through the column
if it is a 1 or 2 digit number
copy and paste the value to column N, O and P
i.e m2 = 1 copy 1 to O2 and P2

if it is a 6 digit number
ie M2=123456 n2 = "=DEC2HEX(RC[-1],5) o2 = "=LEFT(RC[-1],2)" P2 = "=HEX2DEC(RC[-1])


if it is a 76 digit number
ie M2=1234567 n2 = "=DEC2HEX(RC[-1],6) o2 = "=LEFT(RC[-1],2)" P2 = "=HEX2DEC(RC[-1])


What is the best way for me to go about this

thanks

kevin
 
D

Don Guillett

You could use formulas or I would set up a looping macro with
selectcase for the value. How many rows?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top