Pinkster69
New Member
- Joined
- Jun 19, 2012
- Messages
- 48
Hey Guys,
I am looking to find the Max Alphanumeric Serial Number that is in a column and increment by 1! I have code that finds the last "Sequential" serial number in the column and it increments by 1 but unfortunately all my Serial numbers are NOT Sequential in the column!
Can someone please look at my code to see what I have to add to find the Max Alphanumeric Serial Number from a list of NON Sequential Numbers and increment what is found by 1.
Many thanks
Example:
GR1020
GR0950
GR1080
GR1850
GR0760
I am looking to find the Max Alphanumeric Serial Number that is in a column and increment by 1! I have code that finds the last "Sequential" serial number in the column and it increments by 1 but unfortunately all my Serial numbers are NOT Sequential in the column!
Can someone please look at my code to see what I have to add to find the Max Alphanumeric Serial Number from a list of NON Sequential Numbers and increment what is found by 1.
Many thanks
Example:
GR1020
GR0950
GR1080
GR1850
GR0760
Code:
Dim iRow As LongDim ws As Worksheet
Set ws = Worksheets("Goods Return")
'find last data row from database
iRow = ws.Cells(Rows.Count, 3).End(xlUp).Row
If ws.Range("C" & iRow).Value = "" Then
GoodsReturnIDTB.Text = "GR1"
Else
GoodsReturnIDTB.Text = "GR" & Val(Mid(ws.Cells(iRow, 3).Value, 3)) + 1
End If