2-Part Question:
Part 1:
I am fairly new to VBA and attempting to create code in my Userform VBA that will add +1 to each subsequent reference number. I'm working in m "Data" worksheet and column "A". My reference numbers start with "52-" and contain four digits after (ex: 52-0001. 52-0002, etc.). I have tried several different codes using the following:
Part 2
In addition, I would like a MsgBox to appear after selecting "Submit" that will show the new reference ID (ex: "Sample added to log as Sample #: 52-0001"
Thank you!
Part 1:
I am fairly new to VBA and attempting to create code in my Userform VBA that will add +1 to each subsequent reference number. I'm working in m "Data" worksheet and column "A". My reference numbers start with "52-" and contain four digits after (ex: 52-0001. 52-0002, etc.). I have tried several different codes using the following:
VBA Code:
Dim TargetRow As Integer
Dim LstRow As Long 'Figure out last value
Dim OVal As String 'Old Value
Dim NVal As String 'New Value
OTargetRow = Sheets("Engine").Range("B3").Value
TargetRow = Sheets("Engine").Range("B3").Value + 1
Part 2
In addition, I would like a MsgBox to appear after selecting "Submit" that will show the new reference ID (ex: "Sample added to log as Sample #: 52-0001"
Thank you!