Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Loop
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 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Loop
You could use formulas or I would set up a looping macro with
selectcase for the value. How many rows? On Jun 21, 6:54*am, kevcar40 wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find loop doesn't loop | Excel Discussion (Misc queries) | |||
VBA Loop Help | Excel Discussion (Misc queries) | |||
For... Next Loop | Excel Discussion (Misc queries) | |||
vba loop | Excel Discussion (Misc queries) | |||
Any way to loop this in VBA? | Excel Discussion (Misc queries) |