VBA Stringbuilder

  • Thread starter Thread starter David G
  • Start date Start date
D

David G

Hello,

I am just wondering if it is somehow possible to use any sort of
Stringbuilder class in VBA for excel macros to speed up multiple
string concatenations. And if so, how?

David
 
not sure what you're talking about but

Sub makestring()
For Each c In range("d2:d15")
If c <> "" Then ms = ms & "," & c
Next c
MsgBox Right(ms, Len(ms) - 1)
End Sub
 
Dynamically you can create arrays and concatenate them using join :

Sub f()
a = Array("asdfa", "sfasdfa")
d = Join(a, ";")
MsgBox d
End Sub
 
I also seem to recall comparing the string builder class (see other post) with writing the info directly to a local file and the
file approach won hands down.
 
Back
Top