All pastes #790119 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-11-20 02:28 UTC
rendered paste body
Sub runme(x As Integer, sht As String, val As String)
  'add 2 because of the extra 2 rows
  x = x + 2
  If sht = "Actual" Then
    If val = "RS" Then
       If (! + B + x) = 0 Then
         Return
       Else
         tmp = "Actual!B" + x as String
         Return tmp
    End If
  End If
End Sub


----- invoking it -----
Excel cell's value:

=IF(D4=0," ",runme(D4,"Actual","RS"))