Sub Macro1()
'
' Macro1 Macro
'
'
Dim wn, contacts, report As Excel.Window
Dim windows(1 To 100) As Excel.Window
Dim i As Integer
i = 1
For Each wn In Application.windows
windows(i) = wn
i = i + 1
Next wn
If IsEmailValid(windows(1).Cells(1, 1)) = True Then
report = windows(1)
contacts = windows(2)
Else
contacts = windows(1)
report = windows(2)
End If
End Sub
你在这里看到什么错误?根据我对VBA的了解,我正在尽力而为。