I want to count the number of worksheets in the workbook, however the directions
ID: 639886 • Letter: I
Question
I want to count the number of worksheets in the workbook, however the directions tell me I cannot use the count property but rather a loop. I can't figure out how to achieve this?
I need to return a message box like this
There are...
"12" sheets in the workbook "name"
so i need the loop to return the # of sheets which is 12 and the name of the workbook in the message box.
B.) and then I need a 2nd one using the same methods but counting the total number of sheets including chart sheets
message box saying
There are...
14 sheets in the workbook "name"
12 are worksheets
2 are chart sheets
Explanation / Answer
Program:
Dim objExcel As Excel.Application
Dim objWb As Workbook
Set objExcel = New Excel.Application
objExcel.Workbooks.Open
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.