求高手编写一段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