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
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
Forum Posts: 1917
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: Mynda Treacy, Kristi Downer, Riny van Eekelen, Shraddha Sureka, trevor mir, Anthony Blake
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
Catalin Bombea: 1917
SunnyKow: 1432
Anders Sehlstedt: 900
Purfleet: 414
Frans Visser: 346
David_Ng: 306
Hans Hallebeek: 287
lea cohen: 246
Jessica Stewart: 219
A.Maurizio: 216
Newest Members:
manoj Ka
Chris Cowan
Pawel Ganczarski
Molly King
Faraz Rafi
Anthony Blake
Jackb57
Ben Tooke
Kelsey Fennell
Jeffree Bunning
Forum Stats:
Groups: 3
Forums: 24
Topics: 6873
Posts: 30124
Member Stats:
Guest Posters: 49
Members: 33675
Moderators: 2
Admins: 3
Administrators: Mynda Treacy, Philip Treacy, Jessica
Moderators: Velouria, Riny van Eekelen
© Simple:Press —