Files visible or not...

R

rj

Can someone help me out on something I'm sure is easier
than I'm making it? Brain block. Is it Monday?

I need a quick efficient method of looping through all
currently open workbooks and pop up a message box that
tells me the workbook name and whether or not its visible.

Your example code is what I need. Thanks in advance...
 
T

Tom Ogilvy

Dim wkbk as Workbook
for each wkbk in Application.Workbooks
if wkbk.Windows(1).Visible then
msgbox wkbk.Name " is Visible"
else
msgbox wkbk.Name " is not Visible"
end if
Next
 
L

losmac

Sub EnumWorkbooks()
Dim wrbk As Workbook

For Each wrbk In Workbooks
MsgBox wrbk.Name & vbCrLf & wrbk.Windows(wrbk.Name).Visible
Next wrbk

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top