View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Boog[_2_] Boog[_2_] is offline
external usenet poster
 
Posts: 3
Default extracting a number

Hernan,

Maybe this will accomplish your task without using the "LEFT" function

Counter = 1 ' Set the value to the row number of the cell containing the
first value
Do Until ActiveSheet.Cells(Counter,1) = "" ' This only works if there
is a blank cell after your last value and the values are in column A
ActiveSheet.Cells(Counter,1).Value =
INT(ActiveSheet.Cells(Counter,1)/10)
Counter = Counter+1
Loop

If you want column A to retain the original value and column B to contain
the cell value without the last digit, then the 1st line in the DO loop
should read

ActiveSheet.Cells(Counter,2).Value = INT(ActiveSheet.Cells(Counter,1)/10)

Good luck.

Boog

"Hernan" wrote in message
...
I have a column (A) of 300+ rows, with 10 digits in each cell. I need to
remove the last digit of each cell.

I tried =LEFT(A2,9) on column B and then copied the fomula to the last
row,
but when I deleted column A, coumn B gave me a #REF! error. Is there a way
to
convert those number in column B?

Or another way to do this without the use of =LEFT function?

TIA

Hernan.