Conditional Formatting using VBA Code - Change Cell Color basis on Condition

  Рет қаралды 66,849

Excel Destination

Excel Destination

5 жыл бұрын

Conditional Formatting in Excel VBA is very easy and powerful. You can use simple VBA Code with For Loop and If Condition on Worksheet Event to experience Conditional Formatting in Excel with VBA Macro.

Пікірлер: 51
@craigbeuthin4299
@craigbeuthin4299 4 жыл бұрын
Great!!!! Thanks so much - very helpful
@dehash666
@dehash666 4 жыл бұрын
Awesome. Now I know how to change cell color. Thank you. But how do I change color of not just one cell, but all cells to the right from it, lets say 20. If A1 has employee name and micro change color of A1 to red, how change all B1 to Z1. So I need entire row to change color, but only based of value on A1. Thank you.
@firasqatouni4605
@firasqatouni4605 4 жыл бұрын
This is great. It would be a bless if you could provide a VBA on how to change a cell interior based on a specific text in a cell, not cell value.
@luismolina8674
@luismolina8674 2 жыл бұрын
Did you ever find out how to do this in VBA?
@sathishdsk37
@sathishdsk37 4 жыл бұрын
Thanks a lot sir, very very usefull.
@Shraddha2015
@Shraddha2015 2 ай бұрын
Very helpful, thanks!
@floresg4669
@floresg4669 4 жыл бұрын
Thank you very much!! Best video about this I've seen
@Troy-Echo
@Troy-Echo 2 жыл бұрын
Not quite what I was looking for, but handy.
@jayecavallo8759
@jayecavallo8759 2 жыл бұрын
Hello, thank you for this video. I was able to easily implement. Would you be able to tell me how to implement this code based on two cells being true, meaning, if A1=Strawberry and B1= Blueberry, then range A1:B1 has a interior color of red? Much Appreciated
@godday2443
@godday2443 2 жыл бұрын
which code did you use to insert the cells accordingly, like the west, north etc
@limibosi1785
@limibosi1785 3 жыл бұрын
I wanted to have the cell change colour every day. Fir example today blue, tomorrow green and next day different colour and so. Without having a date put in any column. Is this doable?
@clamgoh
@clamgoh 5 жыл бұрын
Thanks for the sharing
@shivambhatia8425
@shivambhatia8425 3 жыл бұрын
I have one question, in the value where you mention specific value then can we select their range as well.
@ExcelDestination
@ExcelDestination 3 жыл бұрын
yes, we can.......
@empresscarrot5417
@empresscarrot5417 2 жыл бұрын
Do you have a macro code that will use the specific text inside a cell? That specific text will change everyday so I need something that will use what's inside the cell as a basis because it changes everyday.
@ezelkarlkl1284
@ezelkarlkl1284 3 жыл бұрын
Thank you ver much for video. how can get backgorund color automaticly from list? I mean (in your example ) if cell's value NORTH , search it on range (I:j) and get the backgorun color from range. value is NORTH will be red background color etc...
@ExcelDestination
@ExcelDestination 3 жыл бұрын
I can give you the logic. You should use looping statement to look for the selected value and then use the matching color for background. We are a freelancing team. If you need any of the VBA Code for your project. Please let us know.
@sasavienne
@sasavienne 4 жыл бұрын
Thanks a lot..
@MKDono
@MKDono 4 жыл бұрын
Biggest problem in this approach that it is not efficient for large tables as the sub is re-evaluated for the entire table after any individual change is made, especially if you copy paste... Is there anyway the same results could be achieved without a global re-evaluation? only evaluate whatever is changed in the step
@ChadFi
@ChadFi 3 жыл бұрын
agree so much. this video is a waste of time.
@genson332
@genson332 3 жыл бұрын
Hi is it possible if I selected a random range and apply the condition? I can only do the setted range but not the selected selection.
@ExcelDestination
@ExcelDestination 3 жыл бұрын
yes, that can be done.
@m.n.953
@m.n.953 2 жыл бұрын
Thank you sir for nice and clear video, I have a question pleas. I make a table that contains in culomn A doctors names and the headers in row1 is the month date. Inside the table all the cells has data validation with departments in hospital to make a monthly rota shift for the doctors. The list of the data valedation contains (main department, long shift, short shift, emergency, operation room, DAY OFF). I want to make a conditional FORMATING THAT IF I CHOOSE "long shift" from the data validation automatically gives this doctor "DAY OFF" for the next day and color the cell of "DAY OFF" in red. How can I do that.( For example if I choose in C5 "long shift" automatically mak D5 "DAY OFF" with red background in B5.) thank you.
@peterjames8046
@peterjames8046 3 жыл бұрын
is it possible to select a single text value and change the whole row colour. E.g. if East was the only word in the row and you want to highlight that whole row is that possible. May select from a drop down list and that will change the whole row colour. Like using conditional formatting formula
@ExcelDestination
@ExcelDestination 3 жыл бұрын
yes, it is possible
@peterjames8046
@peterjames8046 3 жыл бұрын
Would you be able to share how I could do this. I am currently stuck
@phillipswartz4879
@phillipswartz4879 4 жыл бұрын
I learned much from your presentation. I am trying to apply this to a sheet I am building. The only thing that is different is it is a table. I can not get it to work correctly. I think the issue is in the line set. What needs to be different to use this with a table?
@Bhavik_Khatri
@Bhavik_Khatri 3 жыл бұрын
Case statements can also be used.
@ticketingsupervisors3259
@ticketingsupervisors3259 3 жыл бұрын
Is their a way to also change the text color based on the cell color? So if East, it is blue box and white text? Thanks!
@ExcelDestination
@ExcelDestination 3 жыл бұрын
yes, you can use condition for font color also
@ticketingsupervisors3259
@ticketingsupervisors3259 3 жыл бұрын
@@ExcelDestination could you show me how that would look? I tried to add it, but I couldn't get it to change the font color? Thank you.
@rickyrichardson7132
@rickyrichardson7132 4 жыл бұрын
I want to change the color of a cell for creating a call contact log. Green for "Made contact", Yellow for "No answer" and Red for "Phone number is not good". How can I do this? And I enjoyed your video!!
@sankarsandash1318
@sankarsandash1318 2 жыл бұрын
Good learning
@ExcelDestination
@ExcelDestination 2 жыл бұрын
Thanks
@surajthakur5554
@surajthakur5554 5 жыл бұрын
Good thing
@BeDreamerButterfly
@BeDreamerButterfly 4 жыл бұрын
Sir I'm getting this error Private sub worksheet_selectionchange(Byval Target As Range) is coming in yellow highlight After completing all code processes
@ExcelDestination
@ExcelDestination 4 жыл бұрын
without looking at entire code, I can not say what is the reason. I am hoping something is wrong with value or range.
@tayfoooooor
@tayfoooooor 3 жыл бұрын
Me too, I've got the same error :(
@tayfoooooor
@tayfoooooor 3 жыл бұрын
VBA compiler is Idiot, the problem is that i've a typo cause i wrote 'worksheet' withuot s :D
@samawad4564
@samawad4564 4 жыл бұрын
what does "next" do at the end please?
@ExcelDestination
@ExcelDestination 4 жыл бұрын
"next" is closing statement for "For Loop". There are multiple cells in the range and for loop is to go through each cell of the range.
@amanranaji78
@amanranaji78 Жыл бұрын
How to make this dynamic?
@rahulsaikia9969
@rahulsaikia9969 4 жыл бұрын
Hello Sir, you have not defined cell as a variable but in my program which also consists of your following codes is giving me an error for variable not defined. Can you please tell me what it can be??
@ExcelDestination
@ExcelDestination 4 жыл бұрын
without looking at your code, I can not say anything about the error. In VBA, you can use variable without defining, that's the flexibility of VBA.
@rahulsaikia9969
@rahulsaikia9969 4 жыл бұрын
Please help me to sort this out.
@shaikahmed9988
@shaikahmed9988 3 жыл бұрын
i was expecting the "macro code file" in the Description :-(
@ExcelDestination
@ExcelDestination 3 жыл бұрын
it is very short tutorial, you can pause and note the code. If you need the file, please send me email at exceldestination@gmail.com
@udaykakde4595
@udaykakde4595 2 жыл бұрын
How to go to VBA page?
@ChadFi
@ChadFi 3 жыл бұрын
a) bad that it's not a vlookup b) bad that you didn't show actually running the macro but spent 10 minutes formatting c) bad you squeezed 2 adverts into that short video d) bad it didn't work for me e) the comments saying this video is good are wrong
@Ch1n4Sailor
@Ch1n4Sailor 3 жыл бұрын
can't understand a word... so I've muted it... we'll see..
@majidtadavi9623
@majidtadavi9623 3 жыл бұрын
Vba code doesn't work. Tutor didn't even bother to run the code to check any errors... Pathetic..
Datediff in VBA - Calculate difference in years, months and days etc.
8:43
Highlighting Cells Based On Value/Text - Excel VBA
10:00
Data Nik
Рет қаралды 19 М.
Double Stacked Pizza @Lionfield @ChefRush
00:33
albert_cancook
Рет қаралды 57 МЛН
100❤️
00:19
MY💝No War🤝
Рет қаралды 23 МЛН
ТАМАЕВ УНИЧТОЖИЛ CLS ВЕНГАЛБИ! Конфликт с Ахмедом?!
25:37
Excel VBA: The Magic of the Worksheet Change Event
14:24
Excel Macro Mastery
Рет қаралды 71 М.
Excel VBA IF THEN Statement (with ELSEIF & Looping in cells)
12:10
Leila Gharani
Рет қаралды 313 М.
IF Statement in Excel Based on Cell Colour
6:08
Chester Tugwell
Рет қаралды 451 М.
Excel - Using a Macro to set Conditional Formatting
6:51
A Stanmore
Рет қаралды 38 М.
Excel VBA - How to Run Macro when Cell Changes
7:37
Essential Excel
Рет қаралды 38 М.
Excel: Change CELL COLOR based on VALUE of ANOTHER CELL
7:38
Chester Tugwell
Рет қаралды 497 М.
Double Stacked Pizza @Lionfield @ChefRush
00:33
albert_cancook
Рет қаралды 57 МЛН