Rayreloj10
New Member
- Joined
- Jun 26, 2023
- Messages
- 15
- Office Version
- 2019
- Platform
- Windows
I got my macro working in filtering my table upon clicking vbYes in my Msgbox. However, I'm confused bcoz sometimes it filter the other column and obviously I get incorrect filter. Count the column manully correct the code and its worked again and when you tried again will filter another column again.
by the way, im working with multiple excel files here and the code is pretty much the same. I really appriciate someone who can give me explanation here what's happening? is this because of the same coding? I got this vba code below, so as you can see the field is =16 but sometimes it filter =15, this happened after I code the other file. although the field is different, still the filtering is changing.
by the way, im working with multiple excel files here and the code is pretty much the same. I really appriciate someone who can give me explanation here what's happening? is this because of the same coding? I got this vba code below, so as you can see the field is =16 but sometimes it filter =15, this happened after I code the other file. although the field is different, still the filtering is changing.
VBA Code:
If NotificationMsg <> "" Then
If MsgBox("REMINDER:" & " (" & Range("V1") & ")" & " " & " INCOMING PENDING LETTERS." & vbCrLf & vbCrLf & "Would you like to view pending letter(s)?" & vbCrLf & vbCrLf, vbExclamation + vbYesNo, "Pending Letter Reminder") = vbYes Then
Worksheets("Register").Range("A4").AutoFilter Field:=16, Criteria1:="OPEN"
bWarning = True
Else: Worksheets("Register").AutoFilterMode = False
ActiveSheet.Range("$B$4:$T$3000").AutoFilter Field:=16
Range("B5").End(xlDown).Select
lngLastRow = ActiveCell.Row
Rows(lngLastRow).Select
Cells(lngLastRow, "B").Select