
nabila nordin
Member
Members

Forum Posts: 7
Member Since:
August 18, 2022
August 18, 2022

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
Admin

Forum Posts: 1844
Member Since:
November 8, 2013
November 8, 2013

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: Tracy English
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 880
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 237
Jessica Stewart: 219
A.Maurizio: 213
Aye Mu: 201
Hans Hallebeek: 183
Newest Members:
Rob Rooth
Tom Lewis
Jennifer Rodriguez-Avila
Khaled Ibrahim
Kiran Supekar
Lisa Myers
Ronald White
Ginette Guevremont
Taryn Ambrosi
Mark Davenport
Forum Stats:
Groups: 3
Forums: 24
Topics: 6531
Posts: 28604
Member Stats:
Guest Posters: 49
Members: 32822
Moderators: 2
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: Velouria, Riny van Eekelen
© Simple:Press —
