Repost: Loop through files

  • Thread starter Thread starter RJ
  • Start date Start date
R

RJ

I posted this earlier, but it never made it to the screen
so I'm reposting - hope it doesn't duplicate the earlier
one.

I need to loop through all currently open workbooks and
display a message box that tells me the file name and
whether or not the workbook is visible.

Your example code is what I need. Thanks in advance for
your assistance.
 
Hi,

Sub ShowThem()
Dim oBook As Workbook
For Each oBook In Workbooks
MsgBox "Book " & vbNewLine & oBook.FullName _
& vbNewLine & "is " & _
IIf(oBook.Windows(1).Visible, "", "NOT") & "
visible"
Next
End Sub

Regards,

Jan Karel Pieterse
Excel TA/MVP
 
Back
Top