Best way to define a large vba string - i.e. heredoc equivalent?

后端 未结 3 1208
花落未央
花落未央 2020-12-10 02:34

How should I define large strings in VBA? Is there a better way than coding something like the below?

Dim largeString as String
largeString = \"This is a lon         


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-10 02:58

    No, this is as good as it gets.

    For really long strings it might be an option to keep the string in a separate file, or use some application feature. For example, in Word, you might want to store the string in a document variable, as hidden text or AutoText. In Excel, you might consider a hidden sheet for storing long string constants.

提交回复
热议问题