converting from percent to number with two digits...

bestox

Board Regular
Joined
Apr 2, 2009
Messages
82
i would like to convert a percent, let s say 1,00%, to a number with two digits, 1,00, using vba.

Code:
CDbl(cell(1,1))

does not work for converting...

anyone has an indea?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
try

Code:
Sheets("Sheet1").Range("A1").Value = Sheets("Sheet1").Range("A1").Value * 100
Sheets("Sheet1").Range("A1").NumberFormat = "###"
 
Upvote 0
try
Code:
With Cells(1, 1)
    .Value = Val(Replace(.Text, "%", ""))
    .NumberFormat = "#.00"
End With
 
Upvote 0

Forum statistics

Threads
1,215,430
Messages
6,124,846
Members
449,194
Latest member
HellScout

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