Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I am looking for some assistance in compiling some code to complete this task.
I have this code:
Untested, I hope it will return the total number of occurrences of column E values ending in "T" and the value in column J equaling "HP", "RP", and "WP" respectively.
Consider these sample results ...
ttl_trns_hp = 3
ttl_trns_rp = 0
ttl_trns_wp = 1
Of these three values, I need to find the highest value and who it belongs to. In this case, 3 is the highest value and it represents data with column J = "HP"
then ...
I need to find the second highest value, and to who it belongs. In this case, 1 belonging to WP.
I would welcome any suggestions on how to make this work efficiently.
I have this code:
Code:
ttl_trns = WorksheetFunction.CountIf(ws_core.Range("E:E") = "*T")
ttl_trns_hp = WorksheetFunction.CountIfs(ws_core.Range("E:E") = "*T", ws_core.Range("J:J") = "HP")
ttl_trns_rp = WorksheetFunction.CountIfs(ws_core.Range("E:E") = "*T", ws_core.Range("J:J") = "RP")
ttl_trns_wp = WorksheetFunction.CountIfs(ws_core.Range("E:E") = "*T", ws_core.Range("J:J") = "WP")
Untested, I hope it will return the total number of occurrences of column E values ending in "T" and the value in column J equaling "HP", "RP", and "WP" respectively.
Consider these sample results ...
ttl_trns_hp = 3
ttl_trns_rp = 0
ttl_trns_wp = 1
Of these three values, I need to find the highest value and who it belongs to. In this case, 3 is the highest value and it represents data with column J = "HP"
then ...
I need to find the second highest value, and to who it belongs. In this case, 1 belonging to WP.
I would welcome any suggestions on how to make this work efficiently.