Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Identify Excel Chart Sheets 1

Status
Not open for further replies.

rmike

Technical User
Jul 23, 2002
1
US
This should be simple but I can't figure it out.

I want to step through the sheets in a workbook and check to see if the selected sheet is a chart.

nsheets = sheets.count

for i = 1 to nsheets
sheets(i).select

?<code to determine if selected sheet is a chart sheet>

next i
 
try something like

Code:
Dim oSheet As Object

For Each oSheet In ThisWorkbook.Sheets
  If TypeOf oSheet Is Chart Then
    Debug.Print oSheet.Name, TypeName(oSheet)
  ElseIf TypeOf oSheet Is Worksheet Then
    Debug.Print oSheet.Name, TypeName(oSheet)
  Else
    Debug.Print oSheet.Name, TypeName(oSheet)
  End If
Next oSheet
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top