Hi all
Relative newb here, so might be a daft question. I have created a basic Userform which asks for 3 dimensions from a user, on clicking the OK button the idea is that a MsgBox delivers the required information which is derived from a few calculations. See my code so far below:
I can't make the highlighted area work. I'm not 100% sure the MsgBox function can do what i'm asking, though logically it should be able to so I think its just my poor understanding of the code!
Thanks in advance!
Relative newb here, so might be a daft question. I have created a basic Userform which asks for 3 dimensions from a user, on clicking the OK button the idea is that a MsgBox delivers the required information which is derived from a few calculations. See my code so far below:
Code:
Private Sub OKButton_Click()
Dim Msg As String
Dim LineLoad As Integer
LineLoad = 1100
Dim LLLFFL As Integer
LLLFFL = LineLoad - FFLTextBox.Value
Msg = "Glazing details as follows: "
Msg = Msg & vbNewLine
Msg = Msg & vbNewLine
Msg = Msg & WidthTextBox & "mm X " & HeightTextBox & "mm (width x height)"
Msg = Msg & vbNewLine
Msg = Msg & Pane1TextBox & "mm " & Pane1ListBox.Value & " glass LOADED pane"
Msg = Msg & vbNewLine
Msg = Msg & Pane2TextBox & "mm " & Pane2ListBox.Value & " glass OTHER pane"
Msg = Msg & vbNewLine
Msg = Msg & vbNewLine
[COLOR=#ff0000] Msg = Msg & "LINE LOAD @ "[/COLOR]
[COLOR=#ff0000] If HeightTextBox.Value + FFLTextBox.Value < LineLoad Then[/COLOR]
[COLOR=#ff0000] MsgBox = Msg & "n/a"[/COLOR]
[COLOR=#ff0000] ElseIf HeightTextBox.Value + FFLTextBox.Value >= LineLoad Then[/COLOR]
[COLOR=#ff0000] LLLFFL[/COLOR]
[COLOR=#ff0000] End If[/COLOR]
Msg = Msg & vbNewLine
Msg = Msg & "POINT LOAD @ " & WorksheetFunction.Sum(WidthTextBox.Value) / 2 & " X " & WorksheetFunction.Sum(HeightTextBox.Value) / 2
Msg = Msg & vbNewLine
MsgBox Msg
Unload LoadingUserForm
End Sub
I can't make the highlighted area work. I'm not 100% sure the MsgBox function can do what i'm asking, though logically it should be able to so I think its just my poor understanding of the code!

Thanks in advance!