Option Explicit
Private Sub Worksheet_Activate()
frmProducts.Show
Application.MoveAfterReturnDirection = xlDown
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rw As Long, cl As Long
cl = Target.Column
If cl = 5 Then Unload frmQuantity
End Sub
Private Sub Worksheet_Deactivate()
Unload frmProducts
End Sub
Option Explicit
Private Sub Worksheet_Activate()
Dim lr As Long
Application.MoveAfterReturnDirection = xlToRight
lr = Cells(Rows.Count, 1).End(xlUp).Row
Cells(lr + 1, 1).Activate
End Sub
Option Explicit
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim Orw As Long, Prw As Long, cl As Long
Orw = ActiveCell.Row
Prw = ListBox1.ListIndex + 2
If Orw < 2 Then Orw = 2
If Orw > 17 Then Orw = 17
For cl = 1 To 4
Cells(Orw, cl) = shPrd.Cells(Prw, cl)
Next
frmQuantity.Show
Cells(Orw, 5).Activate
AppActivate Application.Caption
End Sub
Option Explicit
Sub NewOrder()
shOrd.Activate
Range("A2:E17").ClearContents
Range("A2").Activate
End Sub
Sub EditProd()
shPrd.Activate
End Sub
Sub Home()
shDsh.Activate
End Sub
|