names of workbooks and sheets need to be exact and case sensitvevb Code:
for wb = 1 to workbooks.count if wb.name = "workbookA.xls" then for each sh in wb.sheets if sh.name = "Sheet1" then a = true: exit for next elseif wb.name = "workbookB.xls" then for each sh in wb.sheets if sh.name = "Sheet2" then b = true: exit for next end if next if a and b then msgbox "both open" else msgbox "both not open end if




Reply With Quote