raccoon588
Board Regular
- Joined
- Aug 5, 2016
- Messages
- 118
I have some code that currently looks for two criteria.
[TABLE="width: 205"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Date Requested[/TD]
[TD]Approved?[/TD]
[/TR]
[TR]
[TD]2/24/2019[/TD]
[TD]Approved
[/TD]
[/TR]
</tbody>[/TABLE]
I would like to add pending as a criteria under approved too. so that if the column has approved or pending it will show up. bellow is what i have for code and it works great for just showing lined that have approved. i cant seem to make the proper adjustment to get it to pull in approved and pending.
[TABLE="width: 205"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Date Requested[/TD]
[TD]Approved?[/TD]
[/TR]
[TR]
[TD]2/24/2019[/TD]
[TD]Approved
[/TD]
[/TR]
</tbody>[/TABLE]
I would like to add pending as a criteria under approved too. so that if the column has approved or pending it will show up. bellow is what i have for code and it works great for just showing lined that have approved. i cant seem to make the proper adjustment to get it to pull in approved and pending.
Code:
Sub Sort()
Dim i As Long
Dim j As Long
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
For i = 4 To 4
For j = 12 To 86 Step 2
With Sheets("RequestLog").Columns("A:G")
.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("Calendar!" & Nb2Let(j) & i & ":" & Nb2Let(j + 1) & i + 1), CopyToRange:=Range("Calendar!" & Nb2Let(j) & i + 4 & ":" & Nb2Let(j + 1) & i + 100), Unique:=False
End With
Next j
Next i
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
Private Function Nb2Let(lng As Long) As String
'Convert To Column Letter
Nb2Let = Split(Cells(1, lng).Address, "$")(1)
End Function