beginvbaanalyst
Board Regular
- Joined
- Jan 28, 2020
- Messages
- 141
- Office Version
- 365
- Platform
- Windows
Hi Everyone,
What if I want multiple msgboxs per each sheet? I realize I can have two different outcomes to a specific scenario.
Is there a way to use IF, THEN?
For instance, if COLUMN L and COLUMN K equaled ONE then I would want a message to say "Burris article, check sourcing", but if COLUMN L equaled ONE, but column K had ZERO I'd want it to say "contact merchant".
Is there a way to do this?
I don't want it to read for Cell 1 but for the entire Column itself.
Currently my code is
What if I want multiple msgboxs per each sheet? I realize I can have two different outcomes to a specific scenario.
Is there a way to use IF, THEN?
For instance, if COLUMN L and COLUMN K equaled ONE then I would want a message to say "Burris article, check sourcing", but if COLUMN L equaled ONE, but column K had ZERO I'd want it to say "contact merchant".
Is there a way to do this?
I don't want it to read for Cell 1 but for the entire Column itself.
Currently my code is
VBA Code:
Sub FilterForBurrisVendor()
'Selects I1 and entire M column, Range J looks for last populated cell
With Range("I1:M" & Range("L" & Rows.Count).End(xlUp).Row)
'Column 4, Equal to 1
.AutoFilter Field:=4, Criteria1:=">1", _
Operator:=xlAnd
.AutoFilter Field:=3, Criteria1:="=1", _
Operator:=xlAnd
.AutoFilter Field:=5, Criteria1:="=0"
End With
'Copies and Pastes Filter Rows into new Worksheet with Name
Sheets("Sheet1").Copy After:=Sheets("MULTIPLE VENDORS NO REGULAR")
ActiveSheet.Name = "BURRIS VENDORS"
If Range("L" & Rows.Count).End(xlUp).Row = 1 Then MsgBox "NO BURRIS ARTICLES"
End Sub