Skip to content

Instantly share code, notes, and snippets.

@Kyeongrok
Last active August 6, 2017 05:09
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/8d15e739acff8eebdf822af59c3ab6d7 to your computer and use it in GitHub Desktop.
Save Kyeongrok/8d15e739acff8eebdf822af59c3ab6d7 to your computer and use it in GitHub Desktop.
excel vba print data for chart
Sub main_print_data()
    Range("a1:z10000").Value = ""
    Range("a1:z10000").ClearFormats
    Call 출력_월
    Call 출력_매장
    Call 출력_데이터
End Sub

Sub 출력_데이터()
    'b2:m27까지 1에서 20까지 랜덤한 숫자를 출력하는
    '서브루틴을 만들어보세요
    '1. B열에 먼저 해보세요
    'int Integer 인티저 정수
    For  = 1 To 12
        For 매장 = 1 To 26
            Cells(매장 + 1,  + 1).Value = Int(Rnd * 20) + 1
        Next
    Next
End Sub

Sub 출력_월()
    '1월부터 12월까지 출력 하는 서브루틴을 만들어보세요
    '가로로 출력해야됩니다.
    'cells를 이용해서
    'cells(행, 열)
    For  = 1 To 12
        Cells(1,  + 1).Value =  & "월"
    Next
End Sub

Sub 출력_매장()
    'A매장 ~ Z매장
    'chr()
    Range("a1").Value = "매장명"
    For 매장 = 1 To 26
        Cells(매장 + 1, 1).Value = Chr(64 + 매장) & "매장"
    Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment