VBA Excel help Colour a cell that contains 0
Closed
clairebear292
Posts
2
Registration date
Wednesday August 8, 2018
Status
Member
Last seen
August 8, 2018
-
Aug 8, 2018 at 02:47 AM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Aug 9, 2018 at 03:53 AM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Aug 9, 2018 at 03:53 AM
Related:
- VBA Excel help Colour a cell that contains 0
- //192.168.l.0 - Guide
- Crimping colour code - Guide
- Number to words in excel formula without vba - Guide
- Vba case like - Guide
- Xbox-2309-1001-3-0 - Download - Digital stores
2 responses
vcoolio
Posts
1411
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
September 6, 2024
262
Aug 9, 2018 at 03:53 AM
Aug 9, 2018 at 03:53 AM
Hello Clairebear292,
Where in this Great Southern Land are you hiding?
Try the following code placed in the worksheet module:-
The code is a Worksheet_Activate event code so once you open the relevant sheet, the code will execute.
To implement the code:-
- Right click on the relevant sheet tab.
- Select "View Code" from the menu that appears.
- In the big white field that then appears, paste the above code.
You can change the ColorIndex to suit yourself.
Once you enter the code, you'll then need to save the workbook with the .xlsm file extension.
I hope that this helps.
Cheerio,
vcoolio.
Where in this Great Southern Land are you hiding?
Try the following code placed in the worksheet module:-
Private Sub Worksheet_Activate() Dim c As Range For Each c In Range("F5:U19") If c.Value = 0 Then c.Interior.ColorIndex = 8 End If Next c End Sub
The code is a Worksheet_Activate event code so once you open the relevant sheet, the code will execute.
To implement the code:-
- Right click on the relevant sheet tab.
- Select "View Code" from the menu that appears.
- In the big white field that then appears, paste the above code.
You can change the ColorIndex to suit yourself.
Once you enter the code, you'll then need to save the workbook with the .xlsm file extension.
I hope that this helps.
Cheerio,
vcoolio.
Aug 8, 2018 at 07:02 PM
I have tried changing the format to text, general, number etc and no luck