DaveHappyNorm
New Member
- Joined
- Jul 22, 2018
- Messages
- 15
Hello
I am trying to add a comment that contains a fair amount of text via a VB macro, but I cannot get the excel to accept the code.
The code I have is:-
Cells((RO + 1), L).Comment.text text:= SIDE_STEP_MAX_COMMENT_MILES & "." & SIDE_STEP_MAX_COMMENT_YARDS & Chr(10) & SIDE_STEP_MAX_COMMENT_SPEED & "mph" & Chr(10) & SIDE_STEP_MAX_COMMENT_DATE & Chr(10) & SIDE_STEP_MAX_COMMENT_RAIL_SECTION & Chr(10) & Chr(10) & "GAUGE S/W = " & SIDE_STEP_MAX_COMMENT_GAUGE_SIDE_WEAR &
Chr (10) & "GAUGE S/S = " & SIDE_STEP_MAX_COMMENT_GAUGE_SIDE_STEP & Chr(10) & Chr(10) & "FIELD S/W = " & SIDE_STEP_MAX_COMMENT_FIELD_SIDE_WEAR & Chr(10) & "FIELD S/S = " & SIDE_STEP_MAX_COMMENT_FIELD_SIDE_STEP & Chr(10) & Chr(10) & "H/W = " & SIDE_STEP_MAX_COMMENT_HEAD_WIDTH & Chr(10) & "H/W REMAINING = " & SIDE_STEP_MAX_COMMENT_HEAD_WIDTH_REMAINING & Chr(10) & "COM S/S = " & SIDE_STEP_MAX_COMMENT_COMBINED_SIDESTEP & Chr(10) & Chr(10) & "V WEAR = " & SIDE_STEP_MAX_COMMENT_VERTICAL_WEAR & Chr(10) & "DEPTH = " & SIDE_STEP_MAX_COMMENT_RAIL_DEPTH & Chr(10) & "F/P CLEARANCE = " & SIDE_STEP_MAX_COMMENT_FISH_PLATE_CLEARANCE & Chr(10) & Chr(10) & "INC= " & SIDE_STEP_MAX_COMMENT_INCLINATION & Chr(10) & Chr(10) & "G/F REM = " & SIDE_STEP_MAX_COMMENT_GAUGE_FACE_REMAINING & Chr(10) & Chr(10) & "LAT = " & SIDE_STEP_MAX_COMMENT_GPS_LAT & Chr(10) & "LONG = " & SIDE_STEP_MAX_COMMENT_GPS_LONG & Chr(10)
As you can see it is very long and I think this is part of the problem. The code contains mostly variables.
Can anyone help with a solution?
Thank you.
I am trying to add a comment that contains a fair amount of text via a VB macro, but I cannot get the excel to accept the code.
The code I have is:-
Cells((RO + 1), L).Comment.text text:= SIDE_STEP_MAX_COMMENT_MILES & "." & SIDE_STEP_MAX_COMMENT_YARDS & Chr(10) & SIDE_STEP_MAX_COMMENT_SPEED & "mph" & Chr(10) & SIDE_STEP_MAX_COMMENT_DATE & Chr(10) & SIDE_STEP_MAX_COMMENT_RAIL_SECTION & Chr(10) & Chr(10) & "GAUGE S/W = " & SIDE_STEP_MAX_COMMENT_GAUGE_SIDE_WEAR &
Chr (10) & "GAUGE S/S = " & SIDE_STEP_MAX_COMMENT_GAUGE_SIDE_STEP & Chr(10) & Chr(10) & "FIELD S/W = " & SIDE_STEP_MAX_COMMENT_FIELD_SIDE_WEAR & Chr(10) & "FIELD S/S = " & SIDE_STEP_MAX_COMMENT_FIELD_SIDE_STEP & Chr(10) & Chr(10) & "H/W = " & SIDE_STEP_MAX_COMMENT_HEAD_WIDTH & Chr(10) & "H/W REMAINING = " & SIDE_STEP_MAX_COMMENT_HEAD_WIDTH_REMAINING & Chr(10) & "COM S/S = " & SIDE_STEP_MAX_COMMENT_COMBINED_SIDESTEP & Chr(10) & Chr(10) & "V WEAR = " & SIDE_STEP_MAX_COMMENT_VERTICAL_WEAR & Chr(10) & "DEPTH = " & SIDE_STEP_MAX_COMMENT_RAIL_DEPTH & Chr(10) & "F/P CLEARANCE = " & SIDE_STEP_MAX_COMMENT_FISH_PLATE_CLEARANCE & Chr(10) & Chr(10) & "INC= " & SIDE_STEP_MAX_COMMENT_INCLINATION & Chr(10) & Chr(10) & "G/F REM = " & SIDE_STEP_MAX_COMMENT_GAUGE_FACE_REMAINING & Chr(10) & Chr(10) & "LAT = " & SIDE_STEP_MAX_COMMENT_GPS_LAT & Chr(10) & "LONG = " & SIDE_STEP_MAX_COMMENT_GPS_LONG & Chr(10)
As you can see it is very long and I think this is part of the problem. The code contains mostly variables.
Can anyone help with a solution?
Thank you.