Thread
:
How can I remove the trailing "1" from a worksheet.
View Single Post
#
2
Posted to microsoft.public.excel.charting
Claus Busch
external usenet poster
Posts: 3,872
How can I remove the trailing "1" from a worksheet.
Hi,
Am Sat, 23 Feb 2013 09:15:08 -0800 (PST) schrieb
:
I have a long column of numbers some large numbers, but they all have a "1" at the end.
How can I use excel to truncate the trailing digit from every entry?
for instance.
801
1761581
etc...
should read
80
176158
your numbers in column A:
=--LEFT(A1,LEN(A1)-1)
or with VBA:
Sub CutLastDigit()
Dim LRow As Long
Dim rngC As Range
LRow = Cells(Rows.Count, 1).End(xlUp).Row
For Each rngC In Range("A1:A" & LRow)
rngC = CLng(Left(rngC, Len(rngC) - 1))
Next
End Sub
Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
Reply With Quote
Claus Busch
View Public Profile
Find all posts by Claus Busch