View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
tlee tlee is offline
external usenet poster
 
Posts: 40
Default How to check the last digit of each cells vaue in the column

Hi JLGWhiz,

Thanks for your help!

tlee



Give this a try:

Sub dk()

x = Right(Range("A1").Value, InStr(Range("A1"), ".") + 1)
MsgBox x

End Sub

Change Range("A1") to your actual range, or object variable for a range.




"tlee" wrote in message
...
Hi Patrick,

Thanks for your message. And I rasie the other thread about check the
decimal point digit.

Could you help ? Thanks

tlee

dim cell as range
for each cell in Range("A1:A500")
if right(cell.value,1)="9" Then
cell.Value = cell.value * 10
end if
next

"tlee" wrote in message
...
Hi all,

Could anyone know how to use Macro to check the last digit (1 to 9) of
the cell value?

e.g.
Cell A1 = 21, 22 ........, 29 then it will be multiply by 10
Cell A2 = 201, 202, ........., 209 then it will be multiply by 10

Thanks

Tlee