oldman
09-30-2013, 12:39 PM
I need to fire a message box "SKU Not on File" if the value of tsku is not found in the source worksheet.
Private Sub cmdqf_Click() 'Populates worksheet automatically from listbox
Application.ScreenUpdating = False
Dim ws As Worksheet
Set ws = Worksheets("SKU LineUp")
Dim nullstring
Application.ScreenUpdating = False
If tsku.Value = "" Or nullstring Then
MsgBox "Please Enter SKU Number"
tsku.SetFocus
Exit Sub
End If
ws.AutoFilterMode = False
ws.Range("b1:g1").AutoFilter Field:=1, Criteria1:="*" & tsku.Text & "*"
With ws.AutoFilter.Range.Offset(1, 0)
.Copy Sheets("Pop").Range("b1")
End With
Me.lb1.List = Worksheets("POP").Cells(1, 1).CurrentRegion.Value
Me.lb1.Selected(0) = True
tsku.Value = ""
End Sub
Private Sub cmdqf_Click() 'Populates worksheet automatically from listbox
Application.ScreenUpdating = False
Dim ws As Worksheet
Set ws = Worksheets("SKU LineUp")
Dim nullstring
Application.ScreenUpdating = False
If tsku.Value = "" Or nullstring Then
MsgBox "Please Enter SKU Number"
tsku.SetFocus
Exit Sub
End If
ws.AutoFilterMode = False
ws.Range("b1:g1").AutoFilter Field:=1, Criteria1:="*" & tsku.Text & "*"
With ws.AutoFilter.Range.Offset(1, 0)
.Copy Sheets("Pop").Range("b1")
End With
Me.lb1.List = Worksheets("POP").Cells(1, 1).CurrentRegion.Value
Me.lb1.Selected(0) = True
tsku.Value = ""
End Sub