How can VBA determine if a tab is a worksheet?

jbrown20bei

New Member
Joined
Aug 10, 2002
Messages
17
I have a macro that opens another workbook or CSV file and creates a chart in that workbook.
the problem that I am having is that if the active tab in the opened workbook is a chart, it has no data to create a chart.
I need to determine if the active tab is a chart or a worksheet. Or I guess more accurately, I need to change the active tab to the worksheet and not a chart in the other workbook.
there is always only one tab that has data, but sometimes there are a few charts already created in that workbook.

I hope I'm being as clear as I can.

Thanks for your help, this community has been amazing over the years.

Jeff
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
How about
VBA Code:
   Worksheets(1).Select
this will select the first worksheet in the book.
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,552
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top