Skip to content

Instantly share code, notes, and snippets.

@Kyeongrok
Created September 30, 2017 05:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kyeongrok/b8573ef1ebdd2eefd4e986bb69a3bb47 to your computer and use it in GitHub Desktop.
Save Kyeongrok/b8573ef1ebdd2eefd4e986bb69a3bb47 to your computer and use it in GitHub Desktop.
Sub main()
    Call 출력_안녕하세요
    Call 출력_안녕히가세요
    Call 출력_메세지("hello")
    Call 출력_누구_메세지("김경록", "bye")
End Sub

'파라메터가 2개인 서브루틴 만들기
Sub 출력_누구_메세지(p_누구, p_메세지)
    'a4에
    Range("a4").Value = p_누구 & "님" & p_메세지
End Sub


'파라메터(parameter, 인수)가 1개인 서브루틴
Sub 출력_메세지(p_메세지)
    Range("a3").Value = p_메세지
End Sub


'파라메터(매개변수) 0개
Sub 출력_안녕하세요()
    Range("a1").Value = "안녕하세요"
End Sub

Sub 출력_안녕히가세요()
    Range("a2").Value = "안녕히가세요"
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment