Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find Chart Sheets in workbook
I am trying to loop through the sheets in a workbook and test to see if the
which sheets are chart sheets. The code is failing is this because of the way I have set up the wrksht variable (i.e. dim as worksheet)? Function IsChartSheet() As Boolean Dim wrksht As Worksheet Dim chrtsht As Chart On Error Resume Next For Each wrksht In ThisWorkbook Set chrtsht = ActiveWorkbook.Charts(wrksht.Name) If Err = 0 Then IsChartSheet = True Debug.Print ActiveSheet.Name Debug.Print "This is a chart sheet!" Else IsChartSheet = False Debug.Print ActiveSheet.Name Debug.Print "This is not a chart sheet!" End If On Error GoTo 0 Set chrtsht = Nothing Next End Function Thanks EM |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copy chart between multiple sheets in workbook | Charts and Charting in Excel | |||
Find exact match, same workbook, different sheets | Excel Discussion (Misc queries) | |||
Find from just certain sheets in a workbook | Excel Programming | |||
Find / Replace sheets vs workbook in VB | Excel Worksheet Functions | |||
How to find the type of Sheet in Excel.Workbook.sheets collection | Excel Programming |