Change color based if cell another sheet are not empty

makis1023

New Member
Joined
Jun 16, 2021
Messages
49
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
Hello,

I am trying to make a cell change color if a range of cells on another worksheet are not empty

ie cell on worksheet TEST1 that need to change color is E3 and have to check if a range of (lets say B2:C10 cells on Worksheet TEST2 are not empty.

Can this be done with conditional formatting of need VBA?

Cheers
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
FormR , Yes this works perfectly if one cell of the range ('TEST2'!B2:C10) is filled. The need is, all the cells of TEST2 (B2:C10) are filled, all the range, not just one.

Thank you
 
Upvote 0
Hello again. I need something more difficult. As you can see I have these 2 sheets. The one (calendar) has one calendar (daily) and when I double click a day it creates a new sheet based on date and data from sheet test19.

test1000.xlsm
ABCDEFGHIJ
1
2Year:2021Month:June
3
4MondayTuesdayWendsdayThursdayFridaySaturdaySunday
531123456
678910111213
714151617181920
821222324252627
92829301234
10567891011
11
12
13
14
15
16
17
18
Calendar
Cell Formulas
RangeFormula
B5B5=DATE($C$2,MATCH($E$2,{"January";"February";"March";"April";"May";"June";"July";"August";"September";"October";"November";"December"},0),1)-WEEKDAY(DATE($C$2,MATCH($E$2,{"January";"February";"March";"April";"May";"June";"July";"August";"September";"October";"November";"December"},0),1),2)+1
C5:H10C5=B5+1
B6:B10B6=B5+7
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B5:H10Expression=MONTH(B5)<>MONTH($B$6)textNO
B5:H10Expression=B5=TODAY()textNO
B5:H10Expression=OR(B5=INT(INDEX(Data;0;1)))textNO
Cells with Data Validation
CellAllowCriteria
C2List2021;2022
E2ListJanuary; February; March; April; May; June; July; August; September; October; November; December


test1000.xlsm
ABCDEFGHIJ
1Α (10:00- 18:00)
2test19total 1total 2total 3total 4total 5total 6
3emp10,00 €
4emp20,00 €0,00 €
5emp30,00 €0,00 €
6emp40,00 €0,00 €0,00 €0,00 €0,00 €
7
8Β (18:00- 00:00)
9total 1total 2total 3total 4total 5total 6
10emp10,00 €
11emp20,00 €0,00 €
12emp30,00 €0,00 €
13emp40,00 €0,00 €0,00 €0,00 €0,00 €
14
15
16
17B2:F6
18B10:F13
test19
Cell Formulas
RangeFormula
A2A2=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,256)
F3:F4F3=SUM(B3-C3-D3-E3)
E11:E12,E4:E5E4=SUM(B4*0.8%)
B6,D13:F13,B13,D6:F6B6=SUM(B3:B5)
C6,C13C6=(G6/1.05)*5%
F10:F11F10=SUM(B10-C10*D10-E10)


I need to check if the range of B2:F6 & B10:F13 at sheet test19 are filled, then change background color of that day at calendar to red. Is that possible?
As you can see I use already conditional formatting for today() at calendar to be yellow

Thanks!
 
Upvote 0
I need to check if the range of B2:F6 & B10:F13 at sheet test19 are filled, then change background color of that day at calendar to red

Hi, did you try:

Excel Formula:
=COUNTA(test19!$B$2:$F$6,test19!$B$10:$F$13)=45
 
Upvote 0
Oh, my mistake
I need to check the newly created sheet , that the name of the sheet is the day of the calendar i.e.. 30-06-2021
The table sheet is the template for the newly created.

The code for the new sheet is

VBA Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim oWs As Worksheet
    Dim ShtName As String
    
    ''///will only run on calendar cells and one cell selected
    If Intersect(Target, Range("B5:N10")) Is Nothing Or Target.CountLarge > 1 Then Exit Sub
    
    Application.ScreenUpdating = False
    
    If Target.Value = Date Then
        ShtName = Format(Date, "dd-mm-yyyy")
        
        If WksExists(ShtName) Then
           If Sheets(ShtName).Visible = xlSheetHidden Then
           Sheets(ShtName).Visible = xlSheetVisible
           Else: Sheets(ShtName).Visible = xlSheetHidden
           End If
            Else:
            With Sheets("test19")
            .Visible = True
            .Copy After:=Sheets(Sheets.Count)
            ActiveSheet.Name = ShtName
            ActiveSheet.Tab.Color = vbWhite
'           .Visible = xlSheetHidden
'            Sheets(ShtName).Visible = xlSheetHidden
        End With
    End If
  Else: On Error Resume Next
    Set oWs = Sheets(Format(Target.Value, "dd-mm-yyyy"))
    If oWs.Visible = xlSheetVisible Then
    oWs.Visible = xlSheetHidden
    Else: oWs.Visible = xlSheetVisible
    End If
    On Error GoTo 0
End If

End Sub

Thank you
 
Upvote 0
Hi, I'm a bit lost to be honest, what does the latest post have to do with the original question about conditional formatting?
 
Upvote 0

Forum statistics

Threads
1,223,713
Messages
6,174,041
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top