kimberly090
Board Regular
- Joined
- May 22, 2014
- Messages
- 99
Hi,
I have 2 sheet on my excel workbook.
1 is Stock In sheet and 1 is Stock Out sheet.
I wish to store the information in Stock Out sheet when the data is found in Stock In.
Stock In sheet:
Stock Out sheet:
For example, the Stock Out sheet only will able to accept the data when the PT# and the Rack is tally with the detail in Stock In sheet.
As below will be the code for my delete button inside my userform:
I have 2 sheet on my excel workbook.
1 is Stock In sheet and 1 is Stock Out sheet.
I wish to store the information in Stock Out sheet when the data is found in Stock In.
Stock In sheet:
Stock Out sheet:
For example, the Stock Out sheet only will able to accept the data when the PT# and the Rack is tally with the detail in Stock In sheet.
As below will be the code for my delete button inside my userform:
Code:
Private Sub TrackOut_Click()Sheets("Stock Out").Activate
Dim cDelete As VbMsgBoxResult
With Me
If Len(.TextBox1.Value) * Len(.PT.Value) * Len(.Rack2.Value) * _
Len(.Operator2.Value) = 0 Then
MsgBox "Please Complete All Fields Before Submit"
Else
cDelete = MsgBox("Are you sure that you want to delete this record", vbYesNo + vbDefaultButton2, "Track Out")
If cDelete = vbYes Then
If Sheets("Stock In").Columns(2).Find(What:=PT.Text) Is Nothing Then
MsgBox "No stock inventory for this PT#"
Exit Sub
End If
eRow = Sheet2.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Cells(eRow, 1).Value = TextBox1.Text
Cells(eRow, 2).Value = PT.Text
Cells(eRow, 3).Value = Rack2.Text
Cells(eRow, 4).Value = Operator2.Text
Else
If cDelete = vbNo Then
Unload Me
End If
End If
End If
End With
End Sub