#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 78
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,522
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find loop doesn't loop JSnow Excel Discussion (Misc queries) 2 June 24th 09 08:28 PM
VBA Loop Help jlclyde Excel Discussion (Misc queries) 2 February 7th 08 10:08 PM
For... Next Loop mike_vr Excel Discussion (Misc queries) 2 January 17th 08 10:40 AM
vba loop Jackie Excel Discussion (Misc queries) 4 February 28th 06 04:20 AM
Any way to loop this in VBA? Bill (Unique as my name) Excel Discussion (Misc queries) 5 February 22nd 06 11:04 PM


All times are GMT +1. The time now is 07:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"