2026_최신기출문제_2025년상시01
-3. 프로시저 작성 10/15
-폼 실행 X 마지막 행에 데이터가 입력되지 않았습니다.
질문 내용: 마지막 행에 데이터가 입력이 안 된다는 뜻인가요? 아니면 마지막 행에 데이터가 적혀있지 않다는 뜻인가요...? 제가 적은 코드에 문제가 있는 걸까요?
Private Sub cmd계산_Click()
입력행 = [B3].Row + [B3].CurrentRegion.Rows.Count
참조행 = cmb방이름.ListIndex + 5
Cells(입력행, 2) = txt고객번호.Value
Cells(입력행, 3) = txt고객명.Value
Cells(입력행, 4) = cmb숙박예정일.Value
Cells(입력행, 5) = txt숙박일수.Value
Cells(입력행, 6) = cmb방이름.Value
Cells(입력행, 7) = Cells(참조행, 11)
If txt숙박일수.Value <= 2 Then
Cells(입력행, 8) = Cells(참조행, 11) * txt숙박일수.Value * (1 - 0#)
ElseIf txt숙박일수.Value <= 4 Then
Cells(입력행, 8) = Cells(참조행, 11) * txt숙박일수.Value * (1 - 0.05)
ElseIf txt숙박일수.Value <= 6 Then
Cells(입력행, 8) = Cells(참조행, 11) * txt숙박일수.Value * (1 - 0.07)
Else
Cells(입력행, 8) = Cells(참조행, 11) * txt숙박일수.Value * (1 - 0.1)
End If
End Sub