Hello all,
Short question regarding a VBA, since i am a novice
I have a longer VBA that automatically opens the newest file in a folder and looks for a sheet, by name.
If the sheet is found, it will activate the sheet - until now everything works just fine.
Now, if the sheet is not found, it gives me an error.
I manage to change the VBA, to give me a message that the sheet was not found in workbook.
Now i want to change it again, so that when i click ok on the msgbox, to close the workbook.
This the end part of my code:
If needed i will paste the entire code, of course.
Thank you
Short question regarding a VBA, since i am a novice
I have a longer VBA that automatically opens the newest file in a folder and looks for a sheet, by name.
If the sheet is found, it will activate the sheet - until now everything works just fine.
Now, if the sheet is not found, it gives me an error.
I manage to change the VBA, to give me a message that the sheet was not found in workbook.
Now i want to change it again, so that when i click ok on the msgbox, to close the workbook.
This the end part of my code:
VBA Code:
Workbooks.Open MyPath & LatestFile, ReadOnly:=True
If Evaluate("isref('xxx'!A1)") Then
Worksheets("xxx").Activate
Else
MsgBox "Sheet not found."
End If
If needed i will paste the entire code, of course.
Thank you