Public Function fn총금액(메뉴)
Dim subTotal() As String, subMenu() As String, tot As Long
subMenu = Split(Sheet5.Cells(메뉴.Row, 5), ",")
subTotal = Split(Sheet5.Cells(메뉴.Row, 6), ",")
tot = 0
For k = 0 To UBound(subMenu)
For S = 2 To Sheet4.Range("A1048576").End(xlUp).Row
If Sheet4.Cells(S, 1).Value = Sheet5.Cells(메뉴.Row, 3).Value Then
If Sheet4.Cells(S, 2).Value = subMenu(k) Then
tot = tot + (Int(Sheet4.Cells(S, 3).Value) * Int(subTotal(k)))
Exit For
End If
End If
Next
Next
fn총금액 = tot
End Function
이런식으로 다른 프로그래밍 언어랑 비슷하게 vba 언어도 저렇게 쓰잖아요.
근데 자바같은경우에는 어느정도 쓰게되면 컨트롤 스페이스바로 문장구조가 잘 기억나지 않거나 들어가야할 문법이 뭔지 힌트라도 주는데
vba 언어는 그냥 닥치고 다 명령문 외워야 하나요...?
댓글 0