Announcement

Collapse
No announcement yet.

Inserting Carriage Return in text strings

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Inserting Carriage Return in text strings

    Good Morning All,

    I have been using Chr(10) to insert carriage returns in strings which I can then display in text boxes on a userform. Unfortunately since I've been upgraded to XP I no longer have the ActiveX add-in which my PC tells me is the missing library.

    Does anyone know how to insert carriage returns without using Chr ?

    Thanks

    John

  • #2
    Hi John

    Try

    MsgBox "hello" & vbLf & "world"

    See Miscellaneous Constants in the VBA help for many more.

    However, if you run this code
    MsgBox "hello" & chr(13) & "world"

    you should only need to go to Tools>References (while in the VBE) and check the reference that is preceded with the word missing.

    Comment


    • #3
      Hi Dave,

      It is the "ActiveEx type library" that is missing. Our IT systems people won't even think about putting it back as they are scared of the dark, spiders and express surprise every time the sun comes up.

      And now with added vbLf my app works again, well, nearly. Still can't get excell to talk to word via "Set wordApp = GetObject(, "Word.Application")" for exactly the same reason. I think I'll just get a worksheet to look like the letter I want and print that instead.

      Thanks for the vbLf tho'

      John

      Comment

      Working...
      X