Re: Truncating a cell value AFTER the decimal place
From: Medemper (notmyaddress_at_here.now)
Date: 02/20/04
- Next message: Bo: "Re: Empty Cell Question."
- Previous message: Jim Chandler: "For each next choking."
- In reply to: nano: "Truncating a cell value AFTER the decimal place"
- Next in thread: John H W: "RE: Truncating a cell value AFTER the decimal place"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 20 Feb 2004 12:30:32 -0600
If you are always removing the last digit of the value:
Sub truncateLastDigit()
temp = ActiveCell.Value
ActiveCell.Value = Left(temp, Len(temp) - 1)
End Sub
"nano >" <<nano.11xstf@excelforum-nospam.com> wrote in message news:nano.11xstf@excelforum-nospam.com...
I am assuming that the following question has a simple solution, however
I haven't found the answer after quickly searching the forum and a VBA
book.
I would like to truncate the cell value in the following manner:
25.7873 to 25.787
My understanding of the truncate function is that it will truncate the
value to 25 and I have tried formatting the number with the following:
Selection.NumberFormat = "#.##0"
The NumberFormat only altered the displayed number, not the value of
the number. How can I easily accomplish this.
Thanks in advance,
Bruce
---
Message posted from http://www.ExcelForum.com/
- Next message: Bo: "Re: Empty Cell Question."
- Previous message: Jim Chandler: "For each next choking."
- In reply to: nano: "Truncating a cell value AFTER the decimal place"
- Next in thread: John H W: "RE: Truncating a cell value AFTER the decimal place"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|