jim may
Well-known Member
- Joined
- Jul 4, 2004
- Messages
- 7,486
I have the following code in a standard module. CreateChart creates a new embedded chart (let's say Chart 1) - the Only Chart on the SheetNamed Main.
CreateChart works fine.
Macro HideChart is not working - I only want to Hide the chart.
I need code to also Show the Chart when I run a macro (not shown)
This is a bit tough; Can someone assist? TIA, Jim
CreateChart works fine.
Macro HideChart is not working - I only want to Hide the chart.
I need code to also Show the Chart when I run a macro (not shown)
This is a bit tough; Can someone assist? TIA, Jim
Code:
Dim ch As Chart
Sub CreateChart()
CRow = ActiveCell.Row
Set CRange = Application.Union(Range("B" & CRow), Range("C" & CRow), Range("M" & CRow))
Set co = ActiveSheet.ChartObjects.Add(150, 150, 550, 365)
Set ch = co.Chart
ch.SetSourceData Source:=CRange
End Sub
Sub HideChart()
'ch.Visible = False
'ActiveSheet.ChartObjects(0).Visible = False
End Sub