excel A1单元格值为 m-n, 如何在B1单元格填入 n-m, 要求用vba宏语句实现。
1个回答
展开全部
你是想把B1的自动设置为A1相反字符串吗?
供你参考
sub setNewStr()
Dim oldStr As String
Dim iLen As Integer
Dim newStr As String
Dim i As Integer
oldStr = Cells(1, 1).Value
iLen = Len(oldStr)
For i = 0 To iLen - 1
newStr = newStr & Mid(oldStr, iLen - i, 1)
cells(1,2).value=newStr
Next
end sub
供你参考
sub setNewStr()
Dim oldStr As String
Dim iLen As Integer
Dim newStr As String
Dim i As Integer
oldStr = Cells(1, 1).Value
iLen = Len(oldStr)
For i = 0 To iLen - 1
newStr = newStr & Mid(oldStr, iLen - i, 1)
cells(1,2).value=newStr
Next
end sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询