I have 2 workbooks that I run macros on "Air.xlsx" and "Ocean.xlsx", they are basically the same but for different purpose. I want to check if one of them is open , and set one of them as Wsht . I can't set them as set Wsht = activesheet because the macro starts from a different sheet.
Set Wsht = Workbooks("Air").ActiveSheet Set Wsht = Workbooks("Ocean").ActiveSheet an error would occur on this because i would only have one of them open.
I was suggested using below method, but i don't think it's an efficient way to do it
For Each wb In Workbooks If wb.Name = "Air.xlsx" Then Set PASsht = Workbooks("Air").ActiveSheet End If Next Is there a way to check if Air or Ocean sheet is open and set one as Wsht?
Thanks
ActiveSheet. A Workbook does not have a propertyActiveSheet.