Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default How to Handle Chart Sheets

i have a code where it populates all the sheet name in a combo
box .. but i get an error when any workbook has chartsheets. i need to
modify this code snippet in such a way that it has to populate even
chart sheets object name in a combo box if not atleast igonore chart
sheets object name ......

For Each wks In ActiveWorkbook.Sheets
If wks.Visible = xlSheetVisible Then
ctrl.AddItem wks.name
End If
Next wks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default How to Handle Chart Sheets

By Declaring Wks as Object I can certainly avoid error but chartseet
name are not populated in combooo box .
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default How to Handle Chart Sheets

Hi,

For just worksheets use,

dim wks as Worksheet

For Each wks In ActiveWorkbook.Worksheets
If wks.Visible = xlSheetVisible Then
ctrl.AddItem wks.name
End If
Next wks

Cheers
Andy

vicky wrote:
i have a code where it populates all the sheet name in a combo
box .. but i get an error when any workbook has chartsheets. i need to
modify this code snippet in such a way that it has to populate even
chart sheets object name in a combo box if not atleast igonore chart
sheets object name ......

For Each wks In ActiveWorkbook.Sheets
If wks.Visible = xlSheetVisible Then
ctrl.AddItem wks.name
End If
Next wks


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Labels and chart sheets Revolveri Excel Discussion (Misc queries) 1 October 14th 08 01:06 PM
Too Many Headings, Values for Chart Feature To Handle??? Dave Charts and Charting in Excel 3 September 5th 07 10:58 PM
Fill handle turned into a move handle Northwoods Excel Discussion (Misc queries) 1 March 2nd 07 04:40 PM
Referencing chart sheets in vba The Big Smelly Ogre Charts and Charting in Excel 1 February 1st 06 07:37 PM
Chart sheets cause data sheets to be blank Jacinthe Charts and Charting in Excel 2 April 29th 05 02:18 PM


All times are GMT +1. The time now is 10:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"