Bluesguy07
New Member
- Joined
- Mar 11, 2016
- Messages
- 28
Good morning. Apparently my last question was a bust and was probably confusing. Luckily I figured out how to do what I needed. Now, My issue is that I want to have the form close and reopen (I think that's the easiest avenue to take) after the user scans data into the 2nd text box.
Currently, there are 2 text boxes. The first one is for Serial Number, the 2nd one is for Weight. I have two command buttons, one to progress to the next set, and one to close the form.
The two possible options are as follows.
User scans into both text boxes, and it automatically adds the Serial Number and Weight - progressing to the next set of data... or...
User scans into both text boxes, and it closes and reopens the form.
Either way, I'm fine with.
My current code is below
Currently, there are 2 text boxes. The first one is for Serial Number, the 2nd one is for Weight. I have two command buttons, one to progress to the next set, and one to close the form.
The two possible options are as follows.
User scans into both text boxes, and it automatically adds the Serial Number and Weight - progressing to the next set of data... or...
User scans into both text boxes, and it closes and reopens the form.
Either way, I'm fine with.
My current code is below
Code:
Private Sub cmdAdd_Click()
Dim LastRow As Long
Dim ws As Worksheet: Set ws = Sheets("Sheet1")
LastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row
ws.Range("A" & LastRow + 1).Value = txtSN.Text
ws.Range("B" & LastRow + 1).Value = txtWeight.Text
txtSN.Text = ""
txtWeight.Text = ""
End Sub
Private Sub cmdClose_Click()
Unload frmSNWeight
End Sub