C
Chip Smith
Essentially I am having a problem with a macro, in that I created a Userform.
Data put into the first txt box will in turn be used to look up that
particular value in my spreadsheet, column K to be exact, once it finds the
value that was inserted in the first txt box in the user form, it then
recalulates a previous entry. heres the macro thus far....
Private Sub cmdAdd_Click()
Dim Order As Boolean
Dim Index As Variant
Dim nextrow As Long
Dim myRng As Range
Order = Me.txtOrder.Value
Set myRng = Range("a:k")
nextrow = Range("k65536").Row + 1
Index = Application.Match(Order, myRng, 0)
If IsError(Index) Then
MsgBox "Not Found, check Order No. and try again"
Else
myRng(Index).Select
ActiveCell.Offset(0, -9).Value = Cells.Value + (Me.txtShip.Value /
Me.txtPart.Value)
End If
Me.txtOrder.Value = ""
Me.txtShip.Value = ""
Me.txtPart.Value = ""
Me.txtOrder.SetFocus
End Sub
Data put into the first txt box will in turn be used to look up that
particular value in my spreadsheet, column K to be exact, once it finds the
value that was inserted in the first txt box in the user form, it then
recalulates a previous entry. heres the macro thus far....
Private Sub cmdAdd_Click()
Dim Order As Boolean
Dim Index As Variant
Dim nextrow As Long
Dim myRng As Range
Order = Me.txtOrder.Value
Set myRng = Range("a:k")
nextrow = Range("k65536").Row + 1
Index = Application.Match(Order, myRng, 0)
If IsError(Index) Then
MsgBox "Not Found, check Order No. and try again"
Else
myRng(Index).Select
ActiveCell.Offset(0, -9).Value = Cells.Value + (Me.txtShip.Value /
Me.txtPart.Value)
End If
Me.txtOrder.Value = ""
Me.txtShip.Value = ""
Me.txtPart.Value = ""
Me.txtOrder.SetFocus
End Sub