直到今天,此行的VBA脚本一直运行良好 repStr = Replace(currentSID,“ t#”,“ SID _”)
替换功能显示 所有参数均为字符串。 currentSID =“ t#3520”
Sub AddSID(sh As Worksheet)
Dim r As Long
Dim c As Long
Dim currentSID As String
Dim maxRow As Long
Dim repStr As String
maxRow = sh.Cells(2000, 1).End(xlUp).Row
For r = maxRow To 2 Step -1
currentSID = sh.Cells(r, 1).Value
repStr = Replace(currentSID, "t#", "SID_")
sh.Cells(r, 1).Value = repStr
currentSID = sh.Cells(r, 1).Value