TheSwamp
Code Red => VB(A) => Topic started by: Biscuits on November 19, 2015, 02:12:29 PM
-
Is it possible to add a carriage return in the middle of this line of code so that the
resulting display would show:
2. LASER: xxx
3. AREA: xxx
rather than 2. LASER: xxx 3. AREA: xxx
INPUTDATA = "2. LASER: " & LaserInchs1 & " " & "3. AREA: " & oFace1
VBA is so foreign to me...any help would be appreciated...Thanks
-
Maybe use vbcrlf (https://msdn.microsoft.com/en-us/library/microsoft.visualbasic.constants.vbcrlf(v=vs.110).aspx) ?
INPUTDATA = "2. LASER: " & LaserInchs1 & vbcrlf & "3. AREA: " & oFace1
-
Another options is chr(13)
INPUTDATA = "2. LASER: " & LaserInchs1 & CHR(13) & " " & "3. AREA: " & oFace1
-
vbCr - Carriage Return
vbLf - Line Feed
vbCrLf - Carriage Return and Line Feed
vbNewLine - Same as vbCrLf
CHR$(10) - Line Feed
CHR$(13) - Carriage Return
In Windows environments, a new line is denoted by the two consecutive characters Carriage Return (vbCr, or CHR$(13), or \r) and Line Feed (vbLf, or CHR$(10), or \n). When you read text files written from Windows, you will generally find that a new line is denoted by that character combination.
In *nix environments, a new line is denoted only by only the Line Feed character.
This is of particular importance when importing text files into databases.