프로시저에서 코드를 입력하고 실행할 때 컴퓨터는 코드가 적힌 차례대로 실행하나요?
맞다면 225p의 5번문제에서 end if의 위치를 Else를 지우고 써도 되고 cells(입력행,7)과 txt제품명="" 사이에 써도 되죠?
그러니까
①If txt제품명 = "" Then
MsgBox "제품명을 입력하시오."
ElseIf txt수량 = "" Then
MsgBox "수량을 입력하시오."
ElseIf txt단가 = "" Then
MsgBox "단가를 입력하시오."
ElseIf cmb결재형태 = "" Then
MsgBox "결제형태를 입력하시오."
End If
입력행 = [b3].Row + [b3].CurrentRegion.Rows.Count
Cells(입력행, 2) = txt판매일자
Cells(입력행, 3) = txt제품명
Cells(입력행, 4) = Val(txt수량)
Cells(입력행, 5) = Val(txt단가)
Cells(입력행, 6) = Format(Val(txt수량) * Val(txt단가), "currency")
Cells(입력행, 7) = cmb결재형태
txt제품명 = ""
txt수량 = ""
txt단가 = ""
cmb결재형태 = ""
②If txt제품명 = "" Then
MsgBox "제품명을 입력하시오."
ElseIf txt수량 = "" Then
MsgBox "수량을 입력하시오."
ElseIf txt단가 = "" Then
MsgBox "단가를 입력하시오."
ElseIf cmb결재형태 = "" Then
MsgBox "결제형태를 입력하시오."
Else
입력행 = [b3].Row + [b3].CurrentRegion.Rows.Count
Cells(입력행, 2) = txt판매일자
Cells(입력행, 3) = txt제품명
Cells(입력행, 4) = Val(txt수량)
Cells(입력행, 5) = Val(txt단가)
Cells(입력행, 6) = Format(Val(txt수량) * Val(txt단가), "currency")
Cells(입력행, 7) = cmb결재형태
End If
txt제품명 = ""
txt수량 = ""
txt단가 = ""
cmb결재형태 = ""
③If txt제품명 = "" Then
MsgBox "제품명을 입력하시오."
ElseIf txt수량 = "" Then
MsgBox "수량을 입력하시오."
ElseIf txt단가 = "" Then
MsgBox "단가를 입력하시오."
ElseIf cmb결재형태 = "" Then
MsgBox "결재형태를 입력하시오."
Else
입력행 = [b3].Row + [b3].CurrentRegion.Rows.Count
Cells(입력행, 2) = CDate(txt판매일자)
Cells(입력행, 3) = txt제품명
Cells(입력행, 4) = Val(txt수량)
Cells(입력행, 5) = Val(txt단가)
Cells(입력행, 6) = Format(Val(txt수량) * Val(txt단가), "currency")
Cells(입력행, 7) = cmb결재형태
txt제품명 = ""
txt수량 = ""
txt단가 = ""
cmb결재형태 = ""
End If
이렇게 3가지 형태로 써도 괜찮은 거죠?
네 위에서 부터 차례대로 수행합니다.
결과가 같다면 상관 없으세요.
좋은 하루 되세요.
"-
*2014-11-17 11:05:34
네 위에서 부터 차례대로 수행합니다.
결과가 같다면 상관 없으세요.
좋은 하루 되세요.
"