Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

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
share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.