I have a userform that I'm able to search a database that I have inside a worksheet or add a new record to the worksheet.
When searching or saving data to the worksheet it uses a three digit record number with leading zeroes. (Example 001)
However, when get a new record number it returns the number without leading zeros.
I need some assistance tweaking this so that it will include the leading zero.
Thanks
Private Sub newRecord_Click()
Dim lastCell As Range
Set lastCell = Worksheets("Data").Cells(Rows.Count, "A").End(xlUp)
TBrecord = lastCell.Value + 1
End Sub
When searching or saving data to the worksheet it uses a three digit record number with leading zeroes. (Example 001)
However, when get a new record number it returns the number without leading zeros.
I need some assistance tweaking this so that it will include the leading zero.
Thanks
Private Sub newRecord_Click()
Dim lastCell As Range
Set lastCell = Worksheets("Data").Cells(Rows.Count, "A").End(xlUp)
TBrecord = lastCell.Value + 1
End Sub