Hello. I can't really get my head around the syntax for these UDF's. I'm no stranger to VBA but this is all new to me. The code below is just part of what I need to get around the 7 'IF' limit in Excel 2000. We have many sheets in a workbook that has cells for depreciation based on the particular month. We have a range of dates on Sheet 'D' - A1 = April to A12 = March the following year. We need cells to refer to this table and depending on what the correspond to, pick values from another range of data.
Can someone please point out my schoolboy error?
Many thanks, Des.
Code:
Function TestDate()
Select Case Range("Q7")
Case Sheets("D").Range("A1")
ActiveCell = "XXX" 'Month 1 - HAS NO CUMULATIVE DEPRECIATION
Case Sheets("D").Range("A2")
ActiveCell = Range("AK10")
Case Sheets("D").Range("A3")
ActiveCell = Range("AL10").........etc
End Select
End Function
Many thanks, Des.