T
Thomas
Hi NG,
Can anyone tell me what i am doing wrong in the below code?
In the first version i was actively selecting the rectangle, and it was
working. I changed it to a with - statement because it was pretty
annoying that the rectangle constantly was selected.
But now?
thx in advance
Thomas
--------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Number
Number = Range("a1").Value
Select Case Number
Case 1
With ActiveSheet.Shapes("Rectangle 1").ShapeRange.Fill
.Visible = msoTrue
.Solid
.ForeColor.SchemeColor = 44
.Transparency = 0.8
End With
Case 2
With ActiveSheet.Shapes("Rectangle 1").ShapeRange.Fill
.Visible = msoTrue
.Solid
.ForeColor.SchemeColor = 34
.Transparency = 0.5
End With
Case 3
With ActiveSheet.Shapes("Rectangle 1").ShapeRange.Fill
.Visible = msoTrue
.Solid
.ForeColor.SchemeColor = 24
.Transparency = 0.3
End With
Case Else
With ActiveSheet.Shapes("Rectangle 1").ShapeRange.Fill
Visible = msoFalse
End With
End Select
End Sub
Can anyone tell me what i am doing wrong in the below code?
In the first version i was actively selecting the rectangle, and it was
working. I changed it to a with - statement because it was pretty
annoying that the rectangle constantly was selected.
But now?
thx in advance
Thomas
--------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Number
Number = Range("a1").Value
Select Case Number
Case 1
With ActiveSheet.Shapes("Rectangle 1").ShapeRange.Fill
.Visible = msoTrue
.Solid
.ForeColor.SchemeColor = 44
.Transparency = 0.8
End With
Case 2
With ActiveSheet.Shapes("Rectangle 1").ShapeRange.Fill
.Visible = msoTrue
.Solid
.ForeColor.SchemeColor = 34
.Transparency = 0.5
End With
Case 3
With ActiveSheet.Shapes("Rectangle 1").ShapeRange.Fill
.Visible = msoTrue
.Solid
.ForeColor.SchemeColor = 24
.Transparency = 0.3
End With
Case Else
With ActiveSheet.Shapes("Rectangle 1").ShapeRange.Fill
Visible = msoFalse
End With
End Select
End Sub