2010-07-15 112 views
3

VBA中是否有类似Java的解决方案用于concatenatin字符串?VBA字符串串联

我想在这样的方式来使用一个MsgBox:

... 
Set UT = Workbooks(dropdownValue).Worksheets(1) 
With UT 
     UT_rows = .Cells(3, 15).End(xlDown).Row 
End With 
MsgBox "Rows of the file: " + UT_rows 

但是,当我这样做,我的代码在这一点上挂断。 (不兼容类型)

+0

代码没问题。我相信消息框会出现,但会被其他(顶级?)窗口重叠。 否则,请提供有关如何调用此代码以及什么是“变量”的更多详细信息。 – GSerg 2010-07-15 09:25:42

+0

“变量”只是一个值,它是从Excel(2003)单元中读出的 – poeschlorn 2010-07-15 09:54:12

回答

10

连接时应始终使用&;

MsgBox "Rows of the file: " & UT_rows 
+0

谢谢,这是重点:)来自java我从来没有想过这个......非常感谢 – poeschlorn 2010-07-15 13:54:23