我有一个宏根据其他行的值禁用某行,女巫工作正常
Private Sub Worksheet_Change(ByVal Target As Range)
Call SecurityColumnsLookup(Target)
End Sub
Private Sub Workbook_Open(ByVal Target As Range)
Call SecurityColumnsLookup(Target)
End Sub
Private Sub SecurityColumnsLookup(ByVal Target As Range)
On Error GoTo MyErr
Err.Clear
ActiveSheet.Unprotect
Application.EnableEvents = False
Select Case Range("V" & (Target.Row)).Value
//do stuff
End Select
ActiveSheet.Protect
Application.EnableEvents = True
Exit Sub
MyErr:
On Error Resume Next
ActiveSheet.Protect
Application.EnableEvents = True
Exit Sub
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Call SecurityColumnsLookup(Target)
End Sub
我想知道的是如何将代码添加到我的宏中以便允许用户重新调整行的大小,因为现在正在发生的事情是当宏处于活动状态并且鼠标悬停在单元格上时重新调整大小图标不会出现
是否可以随时启用重新sizet功能?
谢谢
答案 0 :(得分:1)
我找到了问题的解决方案,如此链接中所述
添加此
ActiveSheet.Protect , AllowFormattingColumns:=True, AllowFormattingRows:=True
Application.EnableEvents = True
让我的宏启用调整大小选项!