1

I am a newbie @ VBA. I want to use the value of a formula in the active cell to feed into another formula (a sum where the active cell sets the limit of the colum rows to be included in the sum).

Should I use Activecell.value or something else?

2 Answers 2

1

Yes, if that is really what you want.

However, the ActiveCell is easily, accidentally changable by the user so you might want to consider using a fixed cell reference such as:

ActiveSheet.Range("A1").Value
0

I would get the range passed to the function, as in =MyFunc(A1) in the excel sheet, and use that information in my formula

Function MyFunc(rng As Range) As Double
MyFunc = rng.Value * 3
End Function

That way, I know exactly what cell my function is getting the data from

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .