这个问题在这里已经有了答案:
Remove whitespace in VBA excel
(2 个回答)
6年前关闭。
基本问题,VBA 入门
StoreValueLocCol = Left(StoreValueLoc, 1)
StoreValueLocRow = Int(Right(StoreValueLoc, 2) + 1)
StoreValueLoc = StoreValueLocCol & Str(StoreValueLocRow)
MsgBox(StoreValueLoc)
我想在 excel VBA 中向下一行,但是当我连接字符串时,它们之间存在空格。
我将其用作解决方案,但我想找出该空间存在的原因
StoreValueLoc = Replace(StoreValueLoc, " ", "")
最佳答案
Str
添加前导空格。使用 CStr
或者只是连接:
StoreValueLoc = StoreValueLocCol & CStr(StoreValueLocRow)
或者:
StoreValueLoc = StoreValueLocCol & StoreValueLocRow
关于string - 为什么中间有空格? VBA excel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35868236/