FryGirl
Well-known Member
- Joined
- Nov 11, 2008
- Messages
- 1,368
- Office Version
- 365
- 2016
- Platform
- Windows
I found some code and with a slight modification I'm not getting the right results.
I have workbook names in A1:A8 in my master workbook. If the workbook with the name in A1:A8 is open, I would like B1:B8 to show the corresponding "Open" or "Closed".
Any thoughts on how to achieve this?
I have workbook names in A1:A8 in my master workbook. If the workbook with the name in A1:A8 is open, I would like B1:B8 to show the corresponding "Open" or "Closed".
Any thoughts on how to achieve this?
Code:
Sub IsWorkBookOpen()
Dim wBook As Workbook
Dim i As Long
On Error Resume Next
For i = 1 To 8
Set wBook = Workbooks(Cells(i, 1))
If wBook Is Nothing Then
Cells(i, 2).Value = "Open" 'Not open
Else
Cells(i, 2).Value = "Open" 'Open
End If
Next i
End Sub
Last edited: