How to get the last digit of a value of a cell to other in VBA ?

Closed
HARIKA - 17 Apr 2013 à 02:21
Zohaib R Posts 2368 Registration date Sunday 23 September 2012 Status Member Last seen 13 December 2018 - 17 Apr 2013 à 03:10
Hello,

I am trying with vba excel that how to get the last digit of a value in one cell to other.suppose I am trying to the get last digit of 99281 on I10 to J10. Digit 1 should be copied to J10. Please help me with the VBA code


Related:

1 response

Zohaib R Posts 2368 Registration date Sunday 23 September 2012 Status Member Last seen 13 December 2018 69
17 Apr 2013 à 03:10
Hi HARIKA,

The following macro will insert the last digit of the number in cell "I10" to cell "J10".

Sub MacroLastDigit ()
Range("J10").Select
Range("J10").FormulaR1C1 = "=RIGHT(RC[-1],1)"
End Sub

Please revert for clarification.