The Chr function for line break Chr(10) and Chr(13) not working when used in Excel VBA, and says "not in library". The same macro working sometimes in some files. how to use Chr without error
Printable View
The Chr function for line break Chr(10) and Chr(13) not working when used in Excel VBA, and says "not in library". The same macro working sometimes in some files. how to use Chr without error
constants :
vbcr
vblf
vbcrlf
(use F2 for object list)
The constants can be used as a string and added to a string...
Eg:
Code:msgbox "This is" & vbcrlf & "A Test",vbokonly
vbNewLine is also another option. All the constants for line breaks are in the f VBA.Constants
library. So by default they should be available in all versions of Excel, but if you are developing in one
version and running in another version that may be an issue, but doubtful.
Thank you all.
Chr function i ithink is available in all versions of Excel.
I developed a macro in excel and saved the file as template. Chr fuction in macro in files created from template not working says "Not in project or library" error. But the original file is working well. Is there any other function for line break which can work all versions.???