Good day,
I've found a macro online that increments cells with numerical value by 1 and inserts it in the row below when you double click the cell.
Is there a way the code can be altered to include alphanumerical value?
The data in my cells are as follow: LI0000, LI0001, LI0002 etc. The current formula will not support it.
Any help would be much appreciated.
Thank you.
I've found a macro online that increments cells with numerical value by 1 and inserts it in the row below when you double click the cell.
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim lastrow As Long
lastrow = Cells(Cells.Rows.Count, "k").End(xlUp).Row + 1
If Not Intersect(Target, Range("k:k")) Is Nothing Then
If Target.Address = Cells(lastrow, "k").Address Then
Application.EnableEvents = False
Cancel = True
Cells(lastrow, "k") = Cells(lastrow - 1, "k") + 1
Application.EnableEvents = True
End If
End If
End Sub
Is there a way the code can be altered to include alphanumerical value?
The data in my cells are as follow: LI0000, LI0001, LI0002 etc. The current formula will not support it.
Any help would be much appreciated.
Thank you.