求高手编写一段EXCEL的VBA代码

2024-11-08 06:03:41
推荐回答(2个)
回答(1):

选定要替换的区域
执行下面的宏

Sub Macro1()
For Each c In Selection
If Left(c, 1) = "0" Then c.Value = Replace(c, "0", "o")
Next
End Sub

回答(2):

Sub Macro1()
'
' Macro1 Macro

'

'
Cells.Replace What:="0", Replacement:="o", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
End Sub