Hi amazing humans, I'm wondering if it's possible to program a macro to execute a certain section of code depending on the value of one cell.

Essentially my code currently grabs 4 cells, and uses those values to filter on another tab.

One of the codes has the possability to be blank or an error, however this has the potential to deliver a blank table after the filter runs.

I'm wondering if it's possible to start the function with something to the effect of.

"if A5 is error then it runs sub 2", the current code is as follows, and the Acct_Value is the potential error/blank

Dim filter_value As String

Sheets("Litigation-Whole").Select
Ent_Value = Range("G4").Value
Off_Value = Range("H4").Value
Cat_Value = Range("J4").Value
Acct_Value = Range("K4").Value
Sheets("Data").Select
Range("A:B,H:P").Select
Selection.EntireColumn.Hidden = False
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=8, Criteria1:= _
Ent_Value
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=9, Criteria1:= _
Off_Value
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=11, Criteria1:= _
Cat_Value
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=12, Criteria1:= _
Acct_Value
Range("A:B,H:P").Select
Selection.EntireColumn.Hidden = True
End Sub
Thanks for taking a look