I am trying to clear the contents of all sheets in MS Excel 2010, except "Dashboard", after which everything needs to be hidden. The 2nd line of code, containing ClearContents starts with problems.
我试图将清白剂改为简单明了,但“留级机”438: 目的并不支持这种财产或方法。 报告具体强调了问题。 明确
Clearing Contents
For Each ws In Worksheets
If ws.Name <> "Dashboard" Then ws.ClearContents
Next
Hiding sheets
For Each sh In ThisWorkbook.Worksheets
If Not sh.Name = "Executive" Then sh.Visible = False
Next sh