I have a workbook with several sheets of data and charts... I want to be able to hide all of the data and individual charts so that when someone opens the workbook they only see a single sheet. I want the individual that opens the workbook to select from a dropdown menu and *poof* that chart is displated on the "front page".... I am pretty proficient with Excel, but not with VBA or the use of Macros. I found the below code, which appears todo want I want.... But it doesn't work. Is there something that I need todo in order for the code to "run"? I need to be able to send these files to others and have it work without them doing anything "special"....
The code I found...
Private Sub Worksheet_Change(ByVal Target As Range)
Dim chartToCopy As ChartObject
'launch macro when InCell dropdown in E3 changes
If Target.Address = Range("e3").Address Then
'delete existing chart
If Me.ChartObjects.Count > 0 Then
Me.ChartObjects(1).Delete
End If
If Target = "Branch1" Then
Set chartToCopy = Sheets("Sheet1").ChartObjects(1)
ElseIf Target = "Branch2" Then
Set chartToCopy = Sheets("Sheet2").ChartObjects(1)
Else
End
End If
chartToCopy.Copy
Me.Paste Range("c5")
Application.CutCopyMode = False
End If
End Sub
Thanks!
Buster
Bookmarks