Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote