ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Error message on Opening (https://www.excelbanter.com/excel-programming/421215-error-message-opening.html)

Noepie

Error message on Opening
 
Hello,

I get an error message on opening a workbook when the sheet "Invoer" is not
active. If it is then the error message doesn't occur. The code is as follows:
__________
Private Sub Workbook_Open()
With Application
Sheets("Portefeuille").Range("Data").ClearContents
Sheets("Invoer").Range("e3").Select
End With
End Sub
___________
Does anyone know what goes wrong.

Regards,

Noepie

Barb Reinhardt

Error message on Opening
 
If you're selecting a range on a sheet, that sheet needs to be active first.
Try adding this in the appropriate location.

Sheets("Invoer").Select
--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"Noepie" wrote:

Hello,

I get an error message on opening a workbook when the sheet "Invoer" is not
active. If it is then the error message doesn't occur. The code is as follows:
__________
Private Sub Workbook_Open()
With Application
Sheets("Portefeuille").Range("Data").ClearContents
Sheets("Invoer").Range("e3").Select
End With
End Sub
___________
Does anyone know what goes wrong.

Regards,

Noepie



All times are GMT +1. The time now is 07:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com