제가 연습하면서 작성한 VBA 매크로 코드입니다.
Me.Cbo년에서 제목에 해당하는 오류가 뜨면서 자료 입력이 되지 않습니다...
Dim ooc As Integer
With Worksheets("신라면세점 관리대장")
bb = .Range("a3").CurrentRegion.Rows.Count + 4
.Cells(ooc, 1).Value = Me.cbo년.Column(0) & "-" & Me.cbo월.Column(0) & "-" & Me.cbo일.Column(0)
.Cells(ooc, 2).Value = Me.cbo거래유형.Column(0)
.Cells(ooc, 3).Value = Me.cbo품목명.Column(0)
.Cells(ooc, 4).Value = Me.txt수량
.Cells(ooc, 5).Value = Me.cbo단가.Column(0)
.Cells(ooc, 6).Value = Val(Me.txt수량) * Val(Me.cbo단가.Column(0))
If Val(txt회수액) <= 0 Then
.Cells(ooc, 7).Value = 0
ElseIf txt회수액 > 0 Then
.Cells(ooc, 8).Value = (Val(Me.txt수량) * Val(Me.cbo단가.Column(0))) - Val(Me.txt회수액)
End If
End With
Unload Me
폼에 컨트롤 이름도 지정 모두 되어있는데 무슨 문제인지 모르겠습니다.