Hi all ..
I have tried to find answers to this but have not found anything that has solved it for me
sh_name = w.Shapes(Application.Caller).Name <<<< ---- This one gives the error
The object with the specified name could not be found
but it should find the names
I have tried to find answers to this but have not found anything that has solved it for me
sh_name = w.Shapes(Application.Caller).Name <<<< ---- This one gives the error
The object with the specified name could not be found
but it should find the names
VBA Code:
Sub ChangeShapeColor()
Dim sh_name As Variant
Dim w As Worksheet
Dim sp As Shape
With Application
.ScreenUpdating = 0
Set w = Worksheets("Dash")
sh_name = w.Shapes(Application.Caller).Name ' <<<<< ---- this one gives the error
For Each sp In w.Shapes
w.Shapes.Range(sp.Name).Select
If sp.Name <> sh_name Then
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(248, 248, 248)
With Selection.ShapeRange.TextFrame2.TextRange.Font
.Fill.ForeColor.RGB = rgbBlack
.Bold = msoFalse
End With
With Selection.ShapeRange.Line
.ForeColor.RGB = rgbBlack
.Weight = 1.2
End With
Else:
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(214, 254, 224)
With Selection.ShapeRange.TextFrame2.TextRange.Font
.Fill.ForeColor.RGB = vbBlack
' .Bold = msoCTrue
End With
With Selection.ShapeRange.Line
.ForeColor.RGB = vbBlack
.Weight = 1.2
End With
End If
Next sp
[A1].Select
.ScreenUpdating = -1
End With
Blad1.Range("A1:CK200").Interior.Color = RGB(255, 255, 255)
End Sub