2010-07-15 85 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