Jumat, Januari 09, 2015

Make New Line On Excel Macro

Example we have code to make message as follows:
Sub namaSub()
  MsgBox "Keep cleanliness"
End Sub

If add one message again:
Sub namaSub()
  MsgBox "Keep cleanliness"
  MsgBox "Because cleanliness is part of faith"
End Sub
then message will appear twice.

If we want to join both of messages:
Sub namaSub()
  MsgBox "Keep cleanliness Because cleanliness is part of faith"
End Sub

If we want to show the message in two lines, then used code & vbCrLf &:
Sub namaSub()
  MsgBox "Keep cleanliness" & vbCrLf & "Because cleanliness is part of faith"
End Sub

Sources:

0 komentar: