Changing Text Changes Color and Counting Based On Color
I am a novice and still learning VBA.
I am herewith enclosing excel sheet containing data.
from Column A to M. except that D column is left blank for later entering data
into that column. I need VBA code and the following are my requirements.
1. If I Use the Keyboard shortcut Ctrl + Y it should insert in the current cell in Column A "Done" and Bold it and then it has to fill in the Yellow as Background color; also while it does this at the same time, I want from the Column B to Column I to be filled with Background color Yellow.
In the same way above for the Keyboard shortcut Ctrl + G it should insert in the current cell in Column A "My Desk" and Bold it and then it has to fill in the Green as Background color; also while it does this at the same time, I want from the Column B to Column I to be filled with Background color Green.
2. In a similar way as above, I need for the other contents in Column A (which you can view in the excel sheet enclosed) there are other status named viz… Print Ready, Priority Sent, Searched with each referenced to the colors that is filled in the excel sheet and with each being given a Keyboard shortcut assigned like above (and I leave those keyboard shortcuts to your choice).
3. The complex part begins. I have already data collected in Column J beginning at J13 named as Client and below that are the names of clients that are multiple/occurrences which are extracted from Column B named as Client and in the next Column K from K14 the multiple/occurrences counts of the clients are calculated already and is displayed (please see my excel sheet).
In Column L beginning at L10 and below is a list of Date Sent that are
multiple/occurences extracted from Column E named as Date Sent and in the next
Column M from M11 the multiple/occurences counts of Date Sent are calculated already and is displayed (Please see my excel sheet).
Now my requirement is that I want to use the functions IF and AND Then Else
etc....in VBA to do the following.
1. IF Column A = "Done" AND Column B = yellow background color AND Column B
MATCHES with Column J14 Then Column O14 minus 1 from Column K14.
For example;
A2 shows Done. So by using the coloring method which I requested above in question 1, the Column B to I will change to yellow. As Column B's background color is yellow now and the contents of B2 is Aaron Bee and if these two criterias match with J14 which has Aaron Bee, Then this formula should minus 1 transaction displayed in O14 and do the same for the other clients upto the last row wherever it ends as the data will vary sometimes.
4. Can I have the above rule applied for the Date Sent counts minus 1 displayed at Column
P11 onwards until last row wherever it ends as the data will vary sometimes.
I do not know if my explanation is clear to you, but I have tried my best to explain. I appreciate any queries though from you; please excuse me if I have gotten things wrong. Please raise any queries which I am unaware of. I want this to be done only in VBA and conditional formatting is a tedious job to copy and paste. Thank you in advance.
Bookmarks