Hi, it's a good start, the problem is with hidden workbooks.
If Workbooks.Count <> 2 Then MsgBox "Please make sure the two usable workbooks are open!": Exit Sub
I have two hidden (Personal.xls and Personal.xlsb) and so might my users. The users might also be totally unaware that there are hidden workbooks open.
I just found some great code that lets me capture the names of all the open workbooks:
Sub ListWorkbooks()
Dim wb As Workbook
Dim ws As Worksheet
Dim i, j As Single
Set ws = Sheets.Add
For j = 1 To Workbooks.Count
Range("A1").Cells(j, 1) = Workbooks(j).Name
For i = 1 To Workbooks(j).Sheets.Count
Range("A1").Cells(j, i + 1) = Workbooks(j).Sheets(i).Name
Next i
Next j
End Sub
But I haven't yet figured out what to do with it.
I might be able to ask them which one to use. Unfortunately, they may not know since it will have an alphanumeric naming scheme that makes no sense.
Bookmarks