|
* 답변하시는 분들께 도움이 되도록 자신의 환경을 아래 항목 옆에 기재해 주세요.
1. 엑셀 버전(95,97,2000,2002):
2. 윈도우즈의 버전(win95,win98,winME,winNT,win2000,winXP):
3. CPU (486,PentiumI/II/III/IV...):
4. RAM (32,64,128,256,512MB,1G...):
* 아래줄에 질문을 작성하세요 >>
발주할때 품목추가를 묻는 메세지에 NO를 누르거나 iCount(발주서의 행의 숫자)가 18보다
크면 품목 입력을 끝내려는 의도인데 품목추가를 묻는 메세지에 NO를 눌러도 자꾸 추가를
하게 됩니다. 수정좀 부탁드립니다.(더운 날씨에 건강하세요.)
---------------------------------------------------------------------------------
Sub Orderdate()
Dim datMyDate As Date
Dim strPartNo As String
Dim iCount As Integer
Dim iOrderQty As Integer
Dim datDelivery As Date
Dim MyOk As Boolean
datMyDate = InputBox("발주 일자를 넣으세요.")
ActiveSheet.Range("N4").Value = datMyDate
iCount = 9
Do While MyOk = vbYes Or iCount <= 18
strPartNo = InputBox("품번을 넣으세요.")
Cells(iCount, 3).Value = strPartNo
iOrderQty = InputBox("발주 수량을 넣으세요.")
Cells(iCount, 8).Value = iOrderQty
datDelivery = InputBox("납기일을 넣으세요.")
Cells(iCount, 12).Value = datDelivery
MyOk = MsgBox("품목을 추가하시겠습니까?", vbYesNo)
iCount = iCount + 1
Loop
End Sub |
|