Skip to content

Instantly share code, notes, and snippets.

@pedroinfo
Created December 5, 2025 18:49
Show Gist options
  • Select an option

  • Save pedroinfo/3fddad68ea5e8bf6ccee6e0c2da925bf to your computer and use it in GitHub Desktop.

Select an option

Save pedroinfo/3fddad68ea5e8bf6ccee6e0c2da925bf to your computer and use it in GitHub Desktop.
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