- Joined
- May 6, 2011
- Messages
- 13
- Reaction score
- 0
Hi, I have a spreadsheet that takes input from a balance, (weighing scales),
I need some vba that would calculate the mean (average weight) and put it in cell D21, but before it does this, the conditions are that the activecell row must be 21 and the range (D1120) must all be populated.
so far I have got
If ActiveCell.Row = 21 Then
Range("D21").Activate
ActiveCell.Locked = False
ActiveCell.Value = WorksheetFunction.Average(Range("D11", "D20"))
this works if the activecell row is 21, but since this is going out to users of the company it must only do this if the range is populated, my knowledge of vba is quite limited so if someone were able to help me out it would be great.
Last edited: