View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
RITCHI RITCHI is offline
external usenet poster
 
Posts: 7
Default referencing active cell works in a sub but not in a custom function

Hi

I want to turn the following sub into a custom function but
substituting Sub Choice() with Function Choice() and End Sub with End
Function didn't work.

Any help would be gratefully received

Sub Choice()
Dim RowRand As Range
Set RowRand = ActiveCell.Offset(0, -1)
Select Case RowRand
Case 45 To 50
ActiveCell = ActiveCell.Offset(0, -10)
Case Is 50
ActiveCell = ActiveCell.Offset(0, -9)
Case Else
ActiveCell = 27.89
End Select
End Sub


Ritchi