nabila nordin
Member
Members
Forum Posts: 7
Member Since:
August 18, 2022
August 18, 2022
Offline
I have difficulty doing:
1. If the user "Leave date" 13-Jul-22", "Payroll Status" is "Inactive".
The result in "Active" field is "No" and "custom_field: Last day of work" is 13/07/2022
2. If the user "Leave date" 31-Aug-22", "Payroll Status" is "Inactive".
The result in "Active" field is "Yes" and "custom_field: Last day of work" is 31/08/2022
Herewith I attach the latest file for your reference.
I'm stuck with this and need your guidance.
Catalin Bombea
Iasi, Romania
Member
Dashboards
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
Forum Posts: 1939
Member Since:
November 8, 2013
November 8, 2013
Offline
Hi Nabila,
1. If the user "Leave date" 13-Jul-22", "Payroll Status" is "Inactive".The result in "Active" field is "No" and "custom_field: Last day of work" is 13/07/20222. If the user "Leave date" 31-Aug-22", "Payroll Status" is "Inactive".The result in "Active" field is "Yes" and "custom_field: Last day of work" is 31/08/2022
For RangeToFilter, you have set an Autofilter:
.AutoFilter Field:=9, Criteria1:="=Active"
Therefore, these entries with Inactive will not show up in the filtered sheet. If you want them to show up in the filter sheet, don't filter them out.
This loop can be cleaned up, formatting should be done outside the loop:
For k = 2 To nwsLastRow
nws.Cells(k, 6) = IIF(nws.Cells(k, 6) = "Active", "Yes", "No")
If nws.Cells(k, 14) = "-" Then nws.Cells(k, 14) = ""
Next k
nws.Range(nws.Cells(2, 10), nws.Cells(nwsLastRow, 10)).NumberFormat = "dd/mm/yyyy"
nws.Range(nws.Cells(2, 14), nws.Cells(nwsLastRow, 14)).NumberFormat = "dd/mm/yyyy"
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online:
Guest(s) 8
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
Catalin Bombea: 1939
SunnyKow: 1432
Anders Sehlstedt: 919
Purfleet: 415
Frans Visser: 349
Hans Hallebeek: 339
David_Ng: 306
lea cohen: 248
Jessica Stewart: 219
A.Maurizio: 216
Newest Members:
Michael Denton
Nick Pascal
David Webb
Johannes Bruentrup
John Jay
Larry Silverman
David Rousseau
Melinda Heidemann
Jose Fuentes
Abigail Hernandez
Forum Stats:
Groups: 3
Forums: 25
Topics: 7072
Posts: 30993
Member Stats:
Guest Posters: 49
Members: 34469
Moderators: 2
Admins: 3
Administrators: Mynda Treacy, Philip Treacy, Jessica
Moderators: Velouria, Riny van Eekelen
© Simple:Press —