每当用户启动“MyMacro”时,我想清除取消选择当前选择。
我正在使用以下代码:
Sub MyMacro()
If Not IsSheetExists("Memory") Then
Worksheets.Add(After:=Worksheets(Worksheets.Count)).name = "Memory"
End If
Sheets("Memory").Visible = xlSheetVisible 'change to xlSheetVeryHidden
ActiveWorkbook.Sheets("Sheet1").Activate
ClearAllSheets
'......
End Sub
Sub ClearAllSheets()
For Each sh In ActiveWorkbook.Sheets
sh.Cells.Clear
sh.Buttons.Delete
Selection.Clear
Next sh
End Sub
为什么不Selection.Clear
清除取消选择当前选择?