PDA

View Full Version : Solved: Excel VBA Code for higlighting Pass Or Fail profile



ajaysnarp
06-07-2012, 05:38 AM
Dear Expertise,

Currently I am working on one project & I am stuck in creating a loop & I have been not able to fine a solution.

It would be of great help if anyone can help me on this with there expertise knowledge.

Please find below a summary on the same.

I have attached a sample spreadsheet in which I have already started working in Sheet1 wherein the raw data is also present.

In the row number there are 7 command buttons out of which I have completed the 5 & the Big 2 are remaining for which I need help.

The completed ones are:-

Mandatory Pass: - when I click on this command button it looks in Column H whether it is Y if so it goes & looks in column A to see whether it is PASS. If it is PASS then it will highlight in GREEN.
Mandatory Fail: - when I click on this command button it looks in Column H whether it is Y if so it goes & looks in column A to see whether it is FAIL. If it is FAIL then it will highlight in RED.
Optional Pass: - when I click on this command button it looks in Column H whether it is N if so it goes & looks in column A to see whether it is PASS. If it is PASS then it will highlight in GREEN.
Optional Fail: - when I click on this command button it looks in Column H whether it is N if so it goes & looks in column A to see whether it is FAIL. If it is FAIL then it will highlight in RED.

The Pending Ones for which I need help are:-

Highlight Pass: When I click on this button it should first look into Column B i.e. Profile (for example a1b1 is the first profile we have & there are 3 rows), for any given profile All Y should have a PASS & atleast one of the N also should have a PASS & then enter profile is considered as PASS.

Highlight Fail: When I click on this button it should first look into Column B i.e. Profile (for example a1b1 is the first profile we have & there are 3 rows), for any given profile atleast one Y should have a FAIL & all N should have a FAIL & then enter profile is considered as FAIL.

I have manually updated in Column I what should be the actual result for that particular profile & please note that in my original sheet this column will not be there.

Just as an FYI I have also created two tabs "after hitting Highlight Pass" & "after hitting Highlight Fail" which contains the expected results from the Sheet 1.

Kindly request to help me out in getting a solution for the Highlight Pass & Highlight Fail.

Hope I would get some help from this expertise forum & also please let me know If in case for any other information required from my end.

Thanks a lot for all your help & time in advance!!

ajaysnarp
06-07-2012, 07:48 AM
Please let me know in case if this is something that can be solved.

Thanks
Ajay Vijay:dunno :dunno

ajaysnarp
06-08-2012, 11:19 AM
:help :help not sure whether this is something doable.:help

Tinbendr
06-08-2012, 12:53 PM
I did complete the loop, but I think your logic for determining Pass/Fail has some holes. Check out the highlight Pass button.

I didn't have time to finish the Fail part.

ajaysnarp
06-09-2012, 10:21 AM
Thanks a lot David..The Higlight pass is working as expected...You are truly very great...:super: :super: :super: :super: .
As per your above instructions i ill go back & check the logic for Pas / Fail & also will work on the fail.

One sincere request :ipray: :ipray: in case if you get time out of your busy schedule please provide me the solution for Fail also.

Have a great day & weekend.

Once again thanks a lot for all your help...i owe a lot to you!!:thumb :beerchug:

Aussiebear
06-09-2012, 11:51 AM
Follow the logic of the "Pass" and transpose

ajaysnarp
06-11-2012, 09:04 AM
Sure Sir...I am marking this thread as solved.

Once again thanks a lot for all your time & help!!.

Thanks

ajaysnarp
06-14-2012, 01:22 AM
I forgot to attach the new version. Please find attached the same.

Tinbendr
06-14-2012, 07:58 AM
OK Ajay, I think I've got it.

I combined both subs into one, passing a true or false to the sub to determine pass or fail.

Give it a spin.:thumb

ajaysnarp
06-14-2012, 08:49 AM
You Rock:super: :super: :super: :super:

The code is working as expected....

Thanks a lot & have a great day:yay :yay :yay