Want to increment a Alphanumeric value in a range of cells
Closed
Ram Gengadar
-
May 2, 2016 at 08:38 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Contributor Last seen December 27, 2022 - May 2, 2016 at 11:42 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Contributor Last seen December 27, 2022 - May 2, 2016 at 11:42 AM
Related:
- How to increment alphanumeric value in excel
- Excel mod apk for pc - Download - Spreadsheets
- How to open excel file in notepad - Guide
- How to convert number to words in excel - Guide
- Gif in excel - Guide
- How to clear formatting in excel - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Contributor
Last seen
December 27, 2022
555
May 2, 2016 at 11:42 AM
May 2, 2016 at 11:42 AM
Hi Ram,
Try the following code:
Best regards,
Trowa
Try the following code:
Sub RunMe()
Dim mVal1 As String, mVal2, x As Integer
mVal1 = Left(Range("B2").Value, 12)
mVal2 = Right(Range("B2").Value, 4)
x = 2
Do
x = x + 1
mVal2 = mVal2 + 1
If Len(mVal2) = 4 Then
Range("B" & x) = mVal1 & mVal2
Else
Range("B" & x) = mVal1 & "0" & mVal2
End If
Loop Until x = 28
End Sub
Best regards,
Trowa