试试以下代码
Sub 清空()
Dim m As Range
Dim n As Range
Set m = Range("C1:G" & ActiveSheet.UsedRange.Rows.Count)
For Each n In a.Cells
If InStr(n, "-") > 0 Then
n = ""
End If
Next
End Sub
假设数据表有100行
sub test()
dim a as range
dim b as range
set a=range("C1:D100")
for each b in a.cells
if instr(b.text,"-")>0 then
b.text=""
end if
next b
end sub