I hope someone can help me. I have created a simple task which does not require using 2 seperate Subs to get it to work, however i hope someone can show me what how to get this to work.
A B C
1 Qty Price Category
2 500 3.75 Z
ABove is the spread sheet layout, with 3 variables, Qty Price and Category.
I want the answer in cell D2 to be equal to qty multiplied by price, and then if Category is "Z" then multiplied by 1 otherwise in all other cases multiplied by 2.
that is easy enough but i want to use two procedures as follows to teach myself how to use variables created in one procedure and use the result in another:
Sub TotalValue()
Call CategoryProc
Cells(2, 4) = Cells(2, 1) * Cells(2, 2) * dd
End Sub
Sub CategoryProc()
If Cells(2, 3) = "Z" Then
dd = 1
Else
dd = 2
End If
End Sub
thanks to all in advance.
BP
Bookmarks