ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Run Time Error '1004' (https://www.excelbanter.com/excel-programming/273199-run-time-error-1004-a.html)

Sam K

Run Time Error '1004'
 
Greetings All,

I am getting a run time error '1004' (select method of range class failed)
only when I click on
a hyperlink in the sheet. Thanks in advance. --Sam K.


Public Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
With Application
.ScreenUpdating = False
.EnableEvents = False
ActiveSheet.unprotect
Windows(1).VisibleRange.WrapText = True ' wrapping text only in the
visible range window
Target.Select
.EnableEvents = True
.ScreenUpdating = True
ActiveSheet.protect
End With
End Sub




All times are GMT +1. The time now is 04:34 PM.

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