Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello-
I would like a program to run only if the activeworksheet is not a chartsheet. Can you please help? I basically need something like: If activeworksheet is a chart then exit sub else ....code... end if Thank you! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way...
Dim wks As Worksheet On Error Resume Next Set wks = ActiveSheet On Error GoTo 0 If wks Is Nothing Then MsgBox "ChartSheet" End If -- HTH... Jim Thomlinson "Filo" wrote: Hello- I would like a program to run only if the activeworksheet is not a chartsheet. Can you please help? I basically need something like: If activeworksheet is a chart then exit sub else ...code... end if Thank you! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Or...
If Typename(ActiveSheet) = "Worksheet" Then ' do your stuff End If - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Filo" wrote in message ... Hello- I would like a program to run only if the activeworksheet is not a chartsheet. Can you please help? I basically need something like: If activeworksheet is a chart then exit sub else ...code... end if Thank you! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
or
Function IsActiveSheetChart() As Boolean Dim c As Chart On Error Resume Next Set c = ActiveWorkbook.Charts(ActiveSheet.Name) If Err = 0 Then IsActiveSheetChart = True Else IsActiveSheetChart = False End If On Error GoTo 0 Set c = Nothing End Function "Filo" wrote: Hello- I would like a program to run only if the activeworksheet is not a chartsheet. Can you please help? I basically need something like: If activeworksheet is a chart then exit sub else ...code... end if Thank you! |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you All. This was very helpful!!
"Filo" wrote: Hello- I would like a program to run only if the activeworksheet is not a chartsheet. Can you please help? I basically need something like: If activeworksheet is a chart then exit sub else ...code... end if Thank you! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Save chart (that's on a chart sheet) to html file? | Charts and Charting in Excel | |||
Check Activesheet for chart sheet or work sheet | Charts and Charting in Excel | |||
Moving Pivot Chart Fields on a chart sheet | Charts and Charting in Excel | |||
Dynamic column chart - copying from Sheet to Sheet. | Excel Discussion (Misc queries) | |||
Dynamic column chart - copying from Sheet to Sheet. | Charts and Charting in Excel |