The Idea Dude
Well-known Member
- Joined
- Aug 15, 2002
- Messages
- 591
- Office Version
- 2016
- Platform
- Windows
Hey everyone!
Lets say I am arriving at some cells and I dont know what they are going to be before I arrive at them, how do I do a sum under the following circumstances using the following example.
A10 is the active cell and where the formula has to go
A9 contains a number
A8 contains a number
A7 Contains a number
A6 is empty (It will be the active cell as my loop progresses and I will be back at the same situation as with A10 at the moment but I may not necessarily have 3 cells above, i might only have 1 with a number in it)
So with the above, A10 would need to sum A9, A8, A7 and thats it because A6 is empty. So in essence the code needs to sum up from the active cell until it reaches an empty cell.
Thanks
Lets say I am arriving at some cells and I dont know what they are going to be before I arrive at them, how do I do a sum under the following circumstances using the following example.
A10 is the active cell and where the formula has to go
A9 contains a number
A8 contains a number
A7 Contains a number
A6 is empty (It will be the active cell as my loop progresses and I will be back at the same situation as with A10 at the moment but I may not necessarily have 3 cells above, i might only have 1 with a number in it)
So with the above, A10 would need to sum A9, A8, A7 and thats it because A6 is empty. So in essence the code needs to sum up from the active cell until it reaches an empty cell.
Thanks