one more text box to a userform

A

~Alan

XL2000
I am adding one more text box to a userform to put information
in column "BT" ROW "2" in "sheet1"
the below code works perfectly
so I figured if I installed a new text box and named it "Textwrknmbr"
then all I would have to do is add a few lines
in the code. i tried and failed please guide me



from here down works perfectly
Private Sub cmdAdd_Click()
Dim r As Long
Dim ws As Worksheet
Set ws = Worksheets("Parts")
With ws
If .AutoFilterMode Then
If .FilterMode Then
.ShowAllData
End If
End If
End With
If Application.CountIf(ws.Range("a:a"), txtPartnumber.Value) > 0 Then
'don 't do it, it's already there
Beep
MsgBox "Duplicate"
Else
'do all your assignments
r = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
ws.Range("A" & r).Value = txtPartnumber.Value
ws.Range("B" & r).Value = txtQty.Value
ws.Range("C" & r).Value = txtdescription.Value
ws.Range("d" & r).Value = txtmanufacture.Value
ws.Range("E" & r).Value = txtprice.Value
ws.Range("F" & r).Value = txtunits.Value
ws.Range("bt$2").Value = Textwrknmbr
With Worksheets("sheet2")
.Cells(.Rows.Count, "DR").End(xlUp).Offset(1, 0).Value _
= txtPartnumber.Value
End With
End If
txtPartnumber.Value = ""
txtQty.Value = ""
txtdescription.Value = ""
txtmanufacture.Value = ""
txtprice.Value = ""
txtunits.Value = ""
Textwrknmbr.Value = ""

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top