Excel custom function help please!
I'm trying to create a custom function that will only add certain columns (the ones labeled "sales") from a certain range. However i keep getting an error message on the first ActiveCell.Offset. Can someone please tell me where the error is and how to correct the function?
v = 0
For i = 1 To 15
If ActiveCell.Value = "Sales" Then
v = v + ActiveCell.Value
Week_Sales = v
Just to clear things up: my range has 15 cells, Monday - Sunday (each weekday has a column for sales and one for stock). Under Sunday I've inserted a 3rd column with total sales in the current week (Week_Sales), which is where i will be using the function.