|
本帖最后由 7176386 于 2016-5-22 19:12 编辑
- Sub FillShapes1()
- Dim sh As Shape
- Dim L
- L = Timer
-
- With ActiveSheet
-
- Application.ScreenUpdating = False
- For Each sh In .Shapes
- .Shapes(sh.Name).TextFrame2.TextRange.Characters.Text = "测试用的字符"
- Next
-
- Application.ScreenUpdating = True
-
- MsgBox Format(Timer - L, "写入字符串用时:###0.0000秒!"), 64 '用时 3.60 秒
-
- L = Timer
-
- For Each sh In .Shapes
- .Shapes(sh.Name).TextFrame2.TextRange.Characters.Text = "1XSDSAAAAAAA"
- Next
-
- MsgBox Format(Timer - L, "写入字符串用时:###0.0000秒!"), 64 '用时 0.15 秒
-
- L = Timer
-
- For Each sh In .Shapes
- .Shapes(sh.Name).TextFrame2.TextRange.Characters.Text = 2.22222222222222E+19
- Next
-
- MsgBox Format(Timer - L, "写入数字用时:###0.0000秒!"), 64 '用时 0.13 秒
- End With
- End Sub
复制代码 请问,写入文本框能提高速度吗?能否解答一下,谢谢。我的小红花已经准备好啦。
|
|