作者:骷髅怪天堂_821 | 来源:互联网 | 2023-05-18 09:26
DimtesttextAsStringtesttextWorksheets(Sheet2).Range(B6).ValueWorksheets(Sheet2).Range(
Dim testtext As String
testtext = Worksheets("Sheet2").Range("B6").Value
Worksheets("Sheet2").Range("B7").Value = testtext
Simple copying of one cell's content into another. But I run into problems when content of B6 is '02345
- after running the macro B7 contains 2345
and I don't want to lose the leading zero. I tried replacing .Value
with .Text
in second line of the code and this didn't help.
将一个单元格的内容简单复制到另一个单元格中。但是当B6的内容为'02345时,我遇到了问题 - 在运行宏B7包含2345之后,我不想失去前导零。我尝试在代码的第二行用.Text替换.Value,这没有帮助。
4 个解决方案