3ddesignbros
New Member
- Joined
- Apr 30, 2022
- Messages
- 9
- Office Version
- 2021
- Platform
- Windows
So I'm writing some VBA code so that when certain things happen certain shapes change to different colors.
Example 1 is a shape-changing color based on if a sheet is visable or not:
This code is working just how it should:
Example 2 is right under example 1 but is a shape-changing color based on if certain rows in a sheet are hidden or not:
This one is not working.
So I know it must be something to do with how I'm hidden the rows but I can't figure it out. Any help would be appreciated!
Example 1 is a shape-changing color based on if a sheet is visable or not:
VBA Code:
If ThisWorkbook.Sheets("FlashForge").Visible = True Then
ThisWorkbook.Sheets("Farm Data").Shapes("FlashforgeButton").Fill.ForeColor.RGB = RGB(139, 217, 139)
Else
ThisWorkbook.Sheets("Farm Data").Shapes("FlashforgeButton").Fill.ForeColor.RGB = RGB(255, 255, 255)
End If
This code is working just how it should:
Example 2 is right under example 1 but is a shape-changing color based on if certain rows in a sheet are hidden or not:
VBA Code:
If ThisWorkbook.Sheets("Filament Data Sheet").Rows("183:194").EntireRow.Hidden = False Then
ThisWorkbook.Sheets("Farm Data").Shapes("Fila16button").Fill.ForeColor.RGB = RGB(139, 217, 139)
Else
ThisWorkbook.Sheets("Farm Data").Shapes("Fila16button").Fill.ForeColor.RGB = RGB(255, 255, 255)
End If
This one is not working.
So I know it must be something to do with how I'm hidden the rows but I can't figure it out. Any help would be appreciated!