책 내용 질문하기
2번에 2번이요
도서
2017 시나공 기출문제집 컴퓨터활용능력 1급 실기
페이지
107
조회수
31
작성일
2017-01-12
작성자
첨부파일

Private Sub cmd입력_Click()

i = [a4].Row + [a4].CurrentRegion.Rows.Count

Cells(i, 1) = txt고객명

If opt고급 = True Then
Cells(i, 2) = "고급"
If opt실버 = True Then
Cells(i, 2) = "실버"
If opt일반 = True Then
Cells(i, 2) = "일반"
End If

Cells(i, 3) = txt매출금액
Cells(i, 4) = lst결제방식

If lst결제방식 = "현금" Then
Cells(i, 5) = txt매출금액 * 0.1
If lst결제방식 = "카드" Then
Cells(i, 5) = txt매출금액 * 0.05
If lst결제방식 = "포인트" Then
Cells(i, 5) = txt매출금액 * 0
End If


End Sub

이렇게 입력하면 왜 실행이 안되는 건가요??

답변
2017-01-16 11:12:57

안녕하세요.

빨강색 표시한 부분을 수정하세요.

Private Sub cmd입력_Click()
i = [a4].Row + [a4].CurrentRegion.Rows.Count

Cells(i, 1) = txt고객명

If opt고급 = True Then
Cells(i, 2) = "고급"
ElseIf opt실버 = True Then
Cells(i, 2) = "실버"
ElseIf opt일반 = True Then
Cells(i, 2) = "일반"
End If

Cells(i, 3) = txt매출금액
Cells(i, 4) = lst결제방식

If lst결제방식 = "현금" Then
Cells(i, 5) = txt매출금액 * 0.1
ElseIf lst결제방식 = "카드" Then
Cells(i, 5) = txt매출금액 * 0.05
ElseIf lst결제방식 = "포인트" Then
Cells(i, 5) = txt매출금액 * 0
End If

End Sub

즐거운 하루 되세요.

  • *
    2017-01-16 11:12:57

    안녕하세요.

    빨강색 표시한 부분을 수정하세요.

    Private Sub cmd입력_Click()
    i = [a4].Row + [a4].CurrentRegion.Rows.Count

    Cells(i, 1) = txt고객명

    If opt고급 = True Then
    Cells(i, 2) = "고급"
    ElseIf opt실버 = True Then
    Cells(i, 2) = "실버"
    ElseIf opt일반 = True Then
    Cells(i, 2) = "일반"
    End If

    Cells(i, 3) = txt매출금액
    Cells(i, 4) = lst결제방식

    If lst결제방식 = "현금" Then
    Cells(i, 5) = txt매출금액 * 0.1
    ElseIf lst결제방식 = "카드" Then
    Cells(i, 5) = txt매출금액 * 0.05
    ElseIf lst결제방식 = "포인트" Then
    Cells(i, 5) = txt매출금액 * 0
    End If

    End Sub

    즐거운 하루 되세요.

· 5MB 이하의 zip, 문서, 이미지 파일만 가능합니다.
· 폭언, 욕설, 비방 등은 관리자에 의해 경고없이 삭제됩니다.