Chewyhairball
Active Member
- Joined
- Nov 30, 2017
- Messages
- 312
- Office Version
- 365
- Platform
- Windows
Hi
I am trying to run this code to delete constants from column I when i leave a sheet.
Private Sub Worksheet_Deactivate()
Columns("I:I").Select
Selection.SpecialCells(xlCellTypeConstants, 2).Select
Selection.ClearContents
End Sub
The code runs fine using a button but if i try to run it using worksheet deactivate i get an error
"select method of range class failed" and debugging highlights "Columns("I:I").Select"
any help would be most appreciated
thanks
Rory
I am trying to run this code to delete constants from column I when i leave a sheet.
Private Sub Worksheet_Deactivate()
Columns("I:I").Select
Selection.SpecialCells(xlCellTypeConstants, 2).Select
Selection.ClearContents
End Sub
The code runs fine using a button but if i try to run it using worksheet deactivate i get an error
"select method of range class failed" and debugging highlights "Columns("I:I").Select"
any help would be most appreciated
thanks
Rory