Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello --
I need to create a custom function that I will use in a formula, and it needs to take action based on the contents of another cell on another worksheet in the same workbook. The idea is to get a different from the formula based on the color of the cell on the other worksheet. Sort of like this: Public Function ComputeCount (<cell reference) as integer if <cell reference.Interior.Color = vbRed then '* do the math one way else '* do the math another way end if end Function While I'm pretty proficient at VBA, I'm just not seeing how to get the function pointing to the cell of interest on the worksheet of interest. I'm used to setting an Worksheet object variable to reference a given worksheet and a Range object variable to reference a given cell (such as in batch-oriented processing), but I've never tried this in a function to be used in a formula. Any suggestions? Thanks in advance, Mark |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ADDRESS Function as cell ref in equation | Excel Discussion (Misc queries) | |||
Assign the cell address with a function | Excel Worksheet Functions | |||
Creating Custom Function - A Little Help Please! | Excel Programming | |||
Creating a Custom Excel Function to Calculate Gini Coefficients | Excel Worksheet Functions | |||
Creating Custom Function: TRIMSTDEV | Excel Programming |