Re: VBA to Automatically Increase the Last Used Value in a Column
Hello again,
Thanks for the sample worksheet ...:wink:
Below is the corrected code:
Code
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column <> 24 Then Exit Sub
If Target.Offset(0, 7).Value = 0 Then
Range("A" & Target.Row).ClearContents: Exit Sub
End If
If Target.Offset(0, 7).Value <= 10 Then
Dim last As Long
Dim lnid As Long
Application.EnableEvents = False
last = Cells(Application.Rows.Count, "A").End(xlUp).Row
lnid = CLng(Replace(Cells(last, "A"), Left(Cells(last, "A"), 1), ""))
Range("A" & Target.Row) = Left(Cells(last, "A"), 1) & lnid + 1
Application.EnableEvents = True
End If
End Sub
Display More
Hope this will help