Morning All
I have the below code that allows a graph to be enlarged if clicked but wondered if there was a way that the same graph could be enlarged to a new sheet then if clicked again the new sheet would be deleted with the graph going to its original size?
Kind Regards
I have the below code that allows a graph to be enlarged if clicked but wondered if there was a way that the same graph could be enlarged to a new sheet then if clicked again the new sheet would be deleted with the graph going to its original size?
Sub MyChart_PIVOTREDDAY()
Dim ws As Worksheet
Dim chto As ChartObject
Dim rSmall As Range, rBig As Range
Static b As Boolean
Set chto = Worksheets("Pivot Red").ChartObjects(2)
Set rSmall = Worksheets("Pivot Red").Range("O8:T17")
Set rBig = Worksheets("Pivot Red").Range("A2:T30")
If b Then
chto.Width = rSmall.Width
chto.Height = rSmall.Height
chto.Left = rSmall.Left
chto.Top = rSmall.Top
Else
chto.Width = rBig.Width
chto.Height = rBig.Height
chto.Left = rBig.Left
chto.Top = rBig.Top
End If
b = Not b
End Sub
Kind Regards