Forum Discussion
Chris405
Oct 05, 2020Copper Contributor
Excel incrementing
Can someone please tell me how to increment by 1 the numbers only when you have letters with the numbers? For example: I have B-001A and need to increment the 001 by 1, so that when I drag it down I ...
NikolinoDE
Oct 05, 2020Gold Contributor
You could also solve it with a VBA procedure:
Sub increment ()
Range ("A1"). Select 'A1 contains e.g. 0AK20001
Selection.AutoFill Destination: = Range ("A1: A30") 'The area A1: A30 is filled out so that 0AK20030 is in A30.
End Sub
You would have to adjust the area.
* It's always good to add your operating system and Excel version.
I would be happy to know if I could help.
Nikolino
I know I don't know anything (Socrates)
Sub increment ()
Range ("A1"). Select 'A1 contains e.g. 0AK20001
Selection.AutoFill Destination: = Range ("A1: A30") 'The area A1: A30 is filled out so that 0AK20030 is in A30.
End Sub
You would have to adjust the area.
* It's always good to add your operating system and Excel version.
I would be happy to know if I could help.
Nikolino
I know I don't know anything (Socrates)