I want to clear unselect the current selection whenever the user starts "MyMacro".
I'm using the following code:
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
Why doesn't Selection.Clear
clear unselect the current selection?