Created
December 5, 2025 18:49
-
-
Save pedroinfo/3fddad68ea5e8bf6ccee6e0c2da925bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub DiagnosticoSheets() | |
| Dim wbThis As Workbook, wbActive As Workbook | |
| Dim msg As String | |
| Set wbThis = ThisWorkbook | |
| Set wbActive = ActiveWorkbook | |
| msg = "ThisWorkbook: " & wbThis.Name & vbCrLf | |
| msg = msg & "ActiveWorkbook: " & IIf(wbActive Is Nothing, "(nenhum)", wbActive.Name) & vbCrLf | |
| msg = msg & "ThisWorkbook.Sheets.Count = " & wbThis.Sheets.Count & vbCrLf | |
| msg = msg & "ThisWorkbook.Worksheets.Count = " & wbThis.Worksheets.Count & vbCrLf | |
| msg = msg & "Lista de abas em ThisWorkbook:" & vbCrLf | |
| Dim i As Long | |
| For i = 1 To wbThis.Sheets.Count | |
| msg = msg & i & " => " & wbThis.Sheets(i).Name & " (Type: " & TypeName(wbThis.Sheets(i)) & ")" & vbCrLf | |
| Next i | |
| MsgBox msg, vbInformation, "Diagnóstico de Sheets" | |
| End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment