Multiple vbcrlf code

  • Thread starter Tony No Baloney
  • Start date
T

Tony No Baloney

I am working on a macro in Word 2007 with VBA. There are few sections
of the code I would like to have
multiple carriage returns (one for seven lines, one for four lines,
etc.).

I am using vbcrlf multiple times (ex. vbCrLf & vbCrLf & vbCrLf &
vbCrLf & vbCrLf ...)

Is there a way to type a shortcut so it looks like this vbCrlf * 6?
 
T

Tony Jollans

You can generate multiple copies of a single character with the String
function, but only single characters and CrLf is two characters. You could
use something like this to overcome that limitation:

Replace(String(3, vbCr), vbCr, vbCrLf)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top