Hi,
I have working on pretty much the same problem here but with some changes.
I am total new to excel vba and I am working on a project in which in which I have to change the shape colour based on the time of the day for example if it is midnight the shape color should be yellow and if it is 6 O'Clock in the morning the shape colour should be green etc.
The number of shape that I have to work with are about 14 and I have been trying my level best to figure out how to put the time interval in the vba code so that it should work but to not avail.
I looked into attaching the excel sheet with my thread but there was no option so I am adding a part of the code that I want to make changes to currently the shape colour change but not with respect to time but I want to merge the time into the if loop so that time can control the colour of the shapes while other will only display what is the value of the shape.
This is some part of the code I want to merge time with.
[ If ss1 = 582693 Or ss2 = 582693 Or ss3 = 582693 Or ss4 = 582693 Or ss5 = 582693 Or ss6 = 582693 Or ss7 = 582693 Or ss8 = 582693 Then
's/s 582693
ActiveSheet.Shapes.Range(Array("Oval 19")).Select
With Selection.ShapeRange.Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(255, 0, 0)
.Transparency = 0.5
.Solid
End With
Else
's/s 582693
ActiveSheet.Shapes.Range(Array("Oval 19")).Select
With Selection.ShapeRange.Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 255, 0)
.Transparency = 0.8
.Solid
End With
End If ]
If anyone can help me with this i would appreciate it a lot.
Thank you, <!-- END TEMPLATE: newreply_reviewbit -->
I have working on pretty much the same problem here but with some changes.
I am total new to excel vba and I am working on a project in which in which I have to change the shape colour based on the time of the day for example if it is midnight the shape color should be yellow and if it is 6 O'Clock in the morning the shape colour should be green etc.
The number of shape that I have to work with are about 14 and I have been trying my level best to figure out how to put the time interval in the vba code so that it should work but to not avail.
I looked into attaching the excel sheet with my thread but there was no option so I am adding a part of the code that I want to make changes to currently the shape colour change but not with respect to time but I want to merge the time into the if loop so that time can control the colour of the shapes while other will only display what is the value of the shape.
This is some part of the code I want to merge time with.
[ If ss1 = 582693 Or ss2 = 582693 Or ss3 = 582693 Or ss4 = 582693 Or ss5 = 582693 Or ss6 = 582693 Or ss7 = 582693 Or ss8 = 582693 Then
's/s 582693
ActiveSheet.Shapes.Range(Array("Oval 19")).Select
With Selection.ShapeRange.Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(255, 0, 0)
.Transparency = 0.5
.Solid
End With
Else
's/s 582693
ActiveSheet.Shapes.Range(Array("Oval 19")).Select
With Selection.ShapeRange.Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 255, 0)
.Transparency = 0.8
.Solid
End With
End If ]
If anyone can help me with this i would appreciate it a lot.
Thank you, <!-- END TEMPLATE: newreply_reviewbit -->