Sub Macro1()
Dim xR As Range
For Each xR In Cells.SpecialCells(xlCellTypeAllValidation)
xR.Validation.ShowError = False
Next
End Sub作者: starry1314 時間: 2015-9-3 09:44
合併格,先解除合併,再復原
Sub Macro1()
Dim xR As Range
On Error Resume Next
For Each xR In Cells.SpecialCells(xlCellTypeAllValidation)
With xR.MergeArea
.UnMerge
.Item(1).Validation.ShowError = False
.Merge
End With
Next
End Sub
若要指定選取區,可改成:
For Each xR In Selection.Cells.SpecialCells(xlCellTypeAllValidation)