Any recommendations on how to shorten my code, OR AT LEAST How to write it on mutiple lines so that I can see it all without having to scroll on screen?
Can I somehow use the "_" (underscore) that I have seen been used before?
varNewDateAnswer = Msgbox("Your current Contract dates are:" & vbLf & vbLf & "DESIGN:" & Chr(9) & Chr(9) & Chr(32) & DesignDate & Chr(9) & "for " & oldDesign_rowsCount & " month(s)" & vbLf & "CONSTRUCTION:" & Chr(9) & Chr(32) & ConstDate & Chr(9) & "for " & oldConst_rowsCount & " month(s)" & vbLf & "POST-OCCUPANCY:" & Chr(9) & Chr(32) & PostDate & Chr(9) & "for " & oldPost_rowsCount & " month(s)" & vbLf & vbLf & "Do you need to change them?!", vbYesNoCancel + vbQuestion)
Last edited by clemsoncooz; 02-08-2012 at 08:32 AM.
Put the underscores where you want ... you need a space before it:
varNewDateAnswer = _ MsgBox("Your current Contract dates are:" & vbLf & vbLf & _ "DESIGN:" & Chr(9) & Chr(9) & Chr(32) & _ DesignDate & Chr(9) & _ "for " & oldDesign_rowsCount & " month(s)" & vbLf & _ "CONSTRUCTION:" & Chr(9) & Chr(32) & _ ConstDate & Chr(9) & _ "for " & oldConst_rowsCount & " month(s)" & vbLf & _ "POST-OCCUPANCY:" & Chr(9) & Chr(32) & _ PostDate & Chr(9) & _ "for " & oldPost_rowsCount & " month(s)" & vbLf & vbLf & _ "Do you need to change them?!", _ vbYesNoCancel + vbQuestion)
Regards, TMS
varNewDateAnswer = MsgBox(Title:="Contract Dates Confirmation", _ Buttons:=vbYesNoCancel + vbQuestion, _ Prompt:="Your current Contract dates are:" & vbLf & _ vbLf & _ "DESIGN:" & Chr(9) & Chr(9) & Chr(32) & DesignDate & Chr(9) & "for " & oldDesign_rowsCount & " month(s)" & vbLf & _ "CONSTRUCTION:" & Chr(9) & Chr(32) & ConstDate & Chr(9) & "for " & oldConst_rowsCount & " month(s)" & vbLf & _ "POST-OCCUPANCY:" & Chr(32) & PostDate & Chr(9) & "for " & oldPost_rowsCount & " month(s)" & vbLf & _ vbLf & _ "Do you need to change them?!")
EDIT: Beat to it by TMS![]()
Last edited by tigeravatar; 02-07-2012 at 04:12 PM.
Hope that helps,
~tigeravatar
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
ok thanks - so I guess though that you are not able to place the underscore within any text that is enclosed by " " ??
Example:
msgbox " blah blah blah blah blah blah blah blah blah _ blah blah blah blah blah blah "
You'd have to split the text but there's no reason why not:
msgbox _ " blah blah blah blah blah " & _ "blah blah blah blah " & _ "blah blah blah blah blah blah "
Regards, TMS
Thanks for the rep.
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks