I have several lines (autoshape line) of the color blue
and would like to change the color of the line to white (or Hide)
if Cell A1="F"
Problem is that Drawn lines do not exist in cells they only have a name
Any Ideas????
I have several lines (autoshape line) of the color blue
and would like to change the color of the line to white (or Hide)
if Cell A1="F"
Problem is that Drawn lines do not exist in cells they only have a name
Any Ideas????
Hello Swieduwi,
Here are two macros to hide and unhide all the lines on the activeworksheet.
_________________________________________________________________
Public Sub HideLines()
Dim I As Integer
With ActiveSheet
For I = 1 To .Shapes.Count
If .Shapes(I).Type = msoLine Then .Visible = False
Next I
End With
End Sub
_________________________________________________________________
Public Sub ShowLines()
Dim I As Integer
With ActiveSheet
For I = 1 To .Shapes.Count
If .Shapes(I).Type = msoLine Then .Visible = True
Next I
End With
End Sub
_________________________________________________________________
Sincerely,
Leith Ross
I just want to hide specific named lines not all lines
for instance
I have 4 blue lines, 3 red lines and 2 green lines
if Cell Sheet!A1 = F then hide blue lines, if Cell Sheet1!A1=A then hide green lines but show
blue and red lines.
and the sheet is not active, Cell A1 is Sheet1!A1
Lines are on Sheet2
Last edited by swieduwi; 04-25-2005 at 06:50 AM.
So far I have come up with this and it does work.
Is there a better way to do this??????
It just looks poor?
Private Sub Worksheet_Calculate()
Dim shp1 As Shape
Dim shp2 As Shape
Dim shp3 As Shape
Dim shp4 As Shape
Select Case Range("A23").Value
Case Is = "f"
Set shp1 = Sheets("Diagram (HA)").Shapes("BlueLine_1")
shp1.Line.Visible = msoFalse
Set shp2 = Sheets("Diagram (HA)").Shapes("BlueLine_2")
shp2.Line.Visible = msoFalse
Set shp3 = Sheets("Diagram (HA)").Shapes("BlueLine_3")
shp3.Line.Visible = msoFalse
Set shp4 = Sheets("Diagram (HA)").Shapes("BlueLine_4")
shp4.Line.Visible = msoFalse
Case Else
Set shp1 = Sheets("Diagram (HA)").Shapes("BlueLine_1")
shp1.Line.Visible = msoTrue
Set shp2 = Sheets("Diagram (HA)").Shapes("BlueLine_2")
shp2.Line.Visible = msoTrue
Set shp3 = Sheets("Diagram (HA)").Shapes("BlueLine_3")
shp3.Line.Visible = msoTrue
Set shp4 = Sheets("Diagram (HA)").Shapes("BlueLine_4")
shp4.Line.Visible = msoTrue
End Select
End Sub
Last edited by swieduwi; 04-25-2005 at 12:41 PM.
I have also tried Leith Ross suggestion, but adding my requirments with no success.
Private Sub Worksheet_Calculate()
Dim I As Integer
Select Case Range("A23").Value
Case Is = "f"
With Worksheets("Diagram (HA)")
For I = 1 To .Shapes("BlueLine_").Count
If .Shapes(I).Type = msoLine Then .Visible = False
Next I
End With
Case Else
With Worksheets("Diagram (HA)")
For I = 1 To .Shapes("BlueLine_").Count
If .Shapes(I).Type = msoLine Then .Visible = True
Next I
End With
End Select
End Sub
Last edited by swieduwi; 04-25-2005 at 11:12 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks