Cell A1 of Sheet2 has a value of 1.
If I type in cell A1 of Sheet1:
=MyFn()
I get a value of 100, as expected because of the code below:
Option Explicit
Function MyFn() As Double
Select Case Sheet2.Cells(1, 1).Value
Case 1
MyFn = 100...
I have a UDF that depends on the value on another sheet:
Option Explicit
Function MyFn(val As Double) As Double
If Sheet1.Cells(1, 1).Value = 1 Then
MyFn = val + 10
Else
MyFn = val + 20
End If
End Function
So in Sheet2, cell B2, I...
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.