Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Antonio! thank you so much for your help. I tried the MID function. It
works great! Is there a way to convert the resulkting number from string to an integer? that is, the mid function returns a "5", instead of a 5 "a.riva@UCL" wrote: Have you tried with string formulas such as MID? Using a For ... Next loop you could write a procedure that extracts at each recursion one of the digits, and you could store them in an array. For example: For i=1 to Len(number) digit(i) = MID(number, i, 1) Next i Antonio. On 15 Oct, 17:08, Paco wrote: Hi Guys! I need to split numbers into its digits which i will latter assign to variables. For instance: originalNumber = 12345 then a = 1 b = 2 c = 3 d = 4 e = 5 I am building a macro, so I cannot use the "text to columns trick" with fixed delimiters Thanks a lot guys!! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I know that there is the possibility of changing the data type of a
variable, but actually I'm not an expert in conversions... I thought that declaring the variable digit() As Double could already solve the problem of converting the string "5" in number 5... Try with the other approach that I posted. It allows you to work with numbers instead of strings, and maybe it's better. I don't have time now to write it in proper code, because I'm just about to leave the office. But I hope it can be a useful suggestion anyway :-) See ya! Antonio. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Antonio! this is great! thank you so much. Have a great day!
Paco "a.riva@UCL" wrote: I know that there is the possibility of changing the data type of a variable, but actually I'm not an expert in conversions... I thought that declaring the variable digit() As Double could already solve the problem of converting the string "5" in number 5... Try with the other approach that I posted. It allows you to work with numbers instead of strings, and maybe it's better. I don't have time now to write it in proper code, because I'm just about to leave the office. But I hope it can be a useful suggestion anyway :-) See ya! Antonio. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA write macro change column with 3 number digits to 4 digits the | Excel Discussion (Misc queries) | |||
number 12 digits to 15 digits | Excel Discussion (Misc queries) | |||
How many number digits can I fit into one cell? | Excel Discussion (Misc queries) | |||
Sum of digits in a number | Excel Worksheet Functions | |||
How to customize number to 10 digits including 2 digits after deci | Excel Worksheet Functions |