5

Is there any Java-like solution for concatenatin strings in VBA?

I want to use a MsgBox in a way like this:

...
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

But when I do that, my code hangs up at this point. (incompatible Types)

2
  • The code is fine. I believe the message box appears but gets overlapped by other (top-level?) windows. Otherwise please provide more details about how this code is called and what is variable. Commented Jul 15, 2010 at 9:25
  • "variable" is just a value, which was read out from an Excel (2003) cell Commented Jul 15, 2010 at 9:54

1 Answer 1

12

You should always use & when concatenating;

MsgBox "Rows of the file: " & UT_rows
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, this was the point :) Coming from java I've never thought about this...thanks a lot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.