Private Sub CommandButton1_Click()
UserForm1.PrintForm
End Sub
Private Sub UserForm_Initialize()
TextBox1 = "Sales have " & IIf([n22>0], "in", "de") & "creased by " & Format([n22], "£#,###,##0") & ", Which is " & Format([O22], "##0.0%") & " " & IIf([n22>0], "higher than the MYR.", "lower than the MYR.")
TextBox2 = "Actual sold quantity has " & IIf([n13>0], "in", "de") & "creased by " & Format([n13], "#,###,##0") & ", Which is " & Format([O13], "##0.0%") & " " & IIf([n13>0], "higher than the MYR.", "lower than the MYR.")
TextBox3 = "Gross margin has " & IIf([n31>0], "in", "de") & "creased by " & Format([n31], "£#,###,##0") & ", Which is " & Format([O31], "##0.0%") & " " & IIf([n31>0], "higher than the MYR.", "lower than the MYR.")
TextBox4 = "The overall GM% is " & IIf([n40>0], "high", "low") & "er than the budget by " & Format([n40], "##0.0%.")
TextBox6 = "Sales have " & IIf([q22>0], "in", "de") & "creased by " & Format([q22], "£#,###,##0") & ", Which is " & Format([r22], "##0.0%") & " " & IIf([q22>0], "higher than last year.", "lower than last year.")
TextBox7 = "Actual sold quantity has " & IIf([q13>0], "in", "de") & "creased by " & Format([q13], "#,###,##0") & ", Which is " & Format([r13], "##0.0%") & " " & IIf([q13>0], "higher than last year.", "lower than last year.")
TextBox8 = "Gross margin has " & IIf([q31>0], "in", "de") & "creased by " & Format([q31], "£#,###,##0") & ", Which is " & Format([r31], "##0.0%") & " " & IIf([q31>0], "higher than last year.", "lower than last year.")
TextBox5 = "The overall GM% is " & IIf([q40>0], "high", "low") & "er than last year by " & Format([q40], "##0.0%.")
Me.TextBox9.Value = Range("D2").Value
TextBox1.Locked = True
TextBox2.Locked = True
TextBox3.Locked = True
TextBox4.Locked = True
TextBox5.Locked = True
TextBox6.Locked = True
TextBox7.Locked = True
TextBox8.Locked = True
TextBox9.Locked = True
End Sub
Its literally a summary box, but i want to extend this now to include graphs, when i put the previously posted code into the module i get this error....
Bookmarks