Converting whole number back to decimal

Excelnewbie001

Board Regular
Joined
Jan 25, 2017
Messages
79
Just need a simple macro to convert a whole column R data to decimal
Example

945
920

So the output should look like this 9, 2, 0 and 9, 4, 5 .Please note there is one space after the decimal.

Thank you for any help
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
so you have a formula in col R, which returns the values 945 (or 920 etc)?

whats the formula?
 
Last edited:
Upvote 0
You want to replace the formulas in Column R with the digits as a comma delimited text string, correct? If so....
Code:
[table="width: 500"]
[tr]
	[td]Sub GetIndividualDigits()
  Dim Cell As Range
  For Each Cell In Range("R1", Cells(Rows.Count, "R").End(xlUp))
    Cell.Value = Replace(Trim(Replace(StrConv(Cell.Value, vbUnicode), Chr(0), " ")), " ", ", ")
  Next
End Sub[/td]
[/tr]
[/table]
If not, then this macro puts the output in Column S...
Code:
[table="width: 500"]
[tr]
	[td]Sub GetIndividualDigits()
  Dim Cell As Range
  For Each Cell In Range("R1", Cells(Rows.Count, "R").End(xlUp))
    Cell.Offset(, 1).Value = Replace(Trim(Replace(StrConv(Cell.Value, vbUnicode), Chr(0), " ")), " ", ", ")
  Next
End Sub[/td]
[/tr]
[/table]
 
Last edited:
Upvote 0
You want to replace the formulas in Column R with the digits as a comma delimited text string, correct? If so....
Code:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Sub GetIndividualDigits()
  Dim Cell As Range
  For Each Cell In Range("R1", Cells(Rows.Count, "R").End(xlUp))
    Cell.Value = Replace(Trim(Replace(StrConv(Cell.Value, vbUnicode), Chr(0), " ")), " ", ", ")
  Next
End Sub[/TD]
[/TR]
</tbody>[/TABLE]
If not, then this macro puts the output in Column S...
Code:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Sub GetIndividualDigits()
  Dim Cell As Range
  For Each Cell In Range("R1", Cells(Rows.Count, "R").End(xlUp))
    Cell.Offset(, 1).Value = Replace(Trim(Replace(StrConv(Cell.Value, vbUnicode), Chr(0), " ")), " ", ", ")
  Next
End Sub[/TD]
[/TR]
</tbody>[/TABLE]


Hi Rick

Thanks so much for your reply -no I would like to keep the formula in R -your second one works flawlessly with output to S thank you so much -fantastic coding there Rick you know your stuff!!!!!! 100% solved thanks
Have a great day
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top