Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove decimal from variable length numbers

Status
Not open for further replies.

renigar

Technical User
Jan 25, 2002
111
US
I need to remove the decimals from a column of numbers and retain all the digits.
Example:

123.45 = 12345
1188.00 = 118800
25.60 = 2560

I've tried find (.) and replace (). It removes the decimal but drops the zeros. I've seen an array formula that works on a fixed number of digits. Using that I think I can do it with a lengthy nested If Then statement on the sheet, but I'm hoping there is a clean reliable way to do it in VBA as part of a macro I'm already running.

Thanks,
renigar
 
Why not simply multiply all the values by 100? to do this, type 100 into an unused cell. Copy the cell. Select the range you want to modify. Choose Edit|Paste Special > Values > Multiply > OK.

Cheers
Paul Edstein
[MS MVP - Word]
 
Then format the numbers for no decimals. Way to easy. Thanks macropod.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top