excel if Range a1a2
Just remove ShapeRange from your code.
Using a variable
Sub try()
Dim sh As Shape
Set sh = ActiveSheet.Shapes("Oval 806")
If Range("C8") Range("C16") Then
sh.Line.Visible = False
End If
Set sh = Nothing
End Sub
Not using a variable
Sub tryAgain()
If Range("C8") Range("C16") Then
ActiveSheet.Shapes("Oval 806") _
.Line.Visible = False
End If
End Sub
Magoo wrote:
Does any one know how to do this using vba.
I would like to have an if statement that is similar to this.
If Range("C8") Range("C16") Then
ActiveSheet.Shapes("Oval 806").Select
Selection.ShapeRange.Line.Visible = False
End If
This will not work Please help...
Thanks
|