Function Help Please

D

Dan R.

I'm using this in Sheet2 to populate values into columns 12 and 13:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim R As Long
R = Target.Row

If Target.Column = 11 Then
Select Case Cells(R, 11)
Case "Data1"
Cells(R, 12) = "AX1035"
Cells(R, 13) = "Outsourced"
Case "Data2"
Cells(R, 12) = "AX1055"
Cells(R, 13) = "Managed"
' etc., etc.
End Select
End If

End Sub

Then I created this Module that uses a custom formula to perform
calculations in column 7 (also on Sheet2):

Public Function RevCal(Test As String, Number As Double) As Double
Application.Volatile

Select Case Test
Case "Acct1"
t = 15
Case "Acct2"
t = 11.5
'etc.
End Select
RevCal = Round(Number / 30, 2) * t

End Function

Before I added the module the values in columns 12 and 13 would
populate as soon as I selected a value from a drop-down box, but now in
order for the values to populate I have to type it in manually (plus it
runs really slow). If I get rid of the Module it works fine again...

Can someone help me figure out what I'm doing wrong?

Thanks,
Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top