Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Function Help Please

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Excel - User Defined Function Error: This function takes no argume BruceInCalgary Excel Programming 3 August 23rd 06 08:53 PM
Need to open the Function Arguments window from VBA for a user defined function. [email protected] Excel Programming 0 June 20th 06 03:53 PM
Offset function with nested match function not finding host ss. MKunert Excel Worksheet Functions 1 March 21st 06 10:46 PM
User-Defined Function pre-empting Built-in Function? How to undo???? MarWun Excel Programming 1 August 6th 03 09:31 PM


All times are GMT +1. The time now is 11:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"