A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Discussion (Misc queries)
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How to extract each digit from a number in one cell?



 
 
Thread Tools Display Modes
  #1  
Old November 9th 06, 01:43 PM posted to microsoft.public.excel.misc
greyhound girl
external usenet poster
 
Posts: 11
Default How to extract each digit from a number in one cell?

I need to extract each digit from a number entered in one cell. I then need
to multiply each digit by another digit. The second part I can handle. It's
how to parse that number into it's separate digits that is the challenge. I
am used to redefine capabilities in other languages but can't find any easy
equivalend in Excel.
Ads
  #2  
Old November 9th 06, 01:56 PM posted to microsoft.public.excel.misc
Don Guillett
external usenet poster
 
Posts: 10,124
Default How to extract each digit from a number in one cell?

See if this idea helps
Sub extracteachnumber()
c = ActiveCell
For i = 1 To Len(c)
MsgBox Mid(c, i, 1) * 4
Next
End Sub

--
Don Guillett
SalesAid Software

"greyhound girl" > wrote in message
...
>I need to extract each digit from a number entered in one cell. I then need
> to multiply each digit by another digit. The second part I can handle.
> It's
> how to parse that number into it's separate digits that is the challenge.
> I
> am used to redefine capabilities in other languages but can't find any
> easy
> equivalend in Excel.



  #3  
Old November 9th 06, 02:28 PM posted to microsoft.public.excel.misc
greyhound girl
external usenet poster
 
Posts: 11
Default How to extract each digit from a number in one cell?

This might do it. I won't be able to try it for about an hour so will let you
know then. Thanks!!

"Don Guillett" wrote:

> See if this idea helps
> Sub extracteachnumber()
> c = ActiveCell
> For i = 1 To Len(c)
> MsgBox Mid(c, i, 1) * 4
> Next
> End Sub
>
> --
> Don Guillett
> SalesAid Software
>
> "greyhound girl" > wrote in message
> ...
> >I need to extract each digit from a number entered in one cell. I then need
> > to multiply each digit by another digit. The second part I can handle.
> > It's
> > how to parse that number into it's separate digits that is the challenge.
> > I
> > am used to redefine capabilities in other languages but can't find any
> > easy
> > equivalend in Excel.

>
>
>

  #4  
Old November 9th 06, 03:49 PM posted to microsoft.public.excel.misc
CLR
external usenet poster
 
Posts: 1,998
Default How to extract each digit from a number in one cell?

Data > TextToColumns > Fixed > and set a column for each digit in your
maximum length number...........

hth
Vaya con Dios,
Chuck, CABGx3



"greyhound girl" wrote:

> I need to extract each digit from a number entered in one cell. I then need
> to multiply each digit by another digit. The second part I can handle. It's
> how to parse that number into it's separate digits that is the challenge. I
> am used to redefine capabilities in other languages but can't find any easy
> equivalend in Excel.

  #5  
Old November 9th 06, 07:42 PM posted to microsoft.public.excel.misc
greyhound girl
external usenet poster
 
Posts: 11
Default How to extract each digit from a number in one cell?

This worked great. I actually had to start from the right most position so
just reversed the counter and end values and added a step -1. I need to do
this with the text entered by a user, calculate a check digit and display the
result as well as use the check digit in building a bar code. I have not
worked much with text boxes. I assume I could use that to gather the data but
wouldn't I need to have a separate calculate button to actually do the
extract? Otherwise, how would the application know when the complete number
had been entered. Any thoughts, suggestions?

"Don Guillett" wrote:

> See if this idea helps
> Sub extracteachnumber()
> c = ActiveCell
> For i = 1 To Len(c)
> MsgBox Mid(c, i, 1) * 4
> Next
> End Sub
>
> --
> Don Guillett
> SalesAid Software
>
> "greyhound girl" > wrote in message
> ...
> >I need to extract each digit from a number entered in one cell. I then need
> > to multiply each digit by another digit. The second part I can handle.
> > It's
> > how to parse that number into it's separate digits that is the challenge.
> > I
> > am used to redefine capabilities in other languages but can't find any
> > easy
> > equivalend in Excel.

>
>
>

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I copy the last digit of a number from a cell Carlos Excel Discussion (Misc queries) 4 September 29th 05 07:17 PM
Extract number in middle of cell SCOOBYDOO Excel Worksheet Functions 2 June 9th 05 02:48 PM
16 digit number wont keep alteration unless format cell to text Croc001 Excel Discussion (Misc queries) 3 March 30th 05 09:12 AM
excel - numbers as text Thuferhawat New Users to Excel 12 January 24th 05 09:29 PM
Formatting a cell as "text" in the number catagory. Ed Excel Worksheet Functions 3 December 7th 04 07:12 PM


All times are GMT +1. The time now is 12:18 PM.


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