auto.pilot
Well-known Member
- Joined
- Sep 27, 2007
- Messages
- 734
- Office Version
- 365
- Platform
- Windows
I searched and also tried to solve this problem but I'm stumped.
I have several columns populated with positive numbers, but some are zero. I'd like a VBA method to change the zero's to whatever number is in the cell directly above. I suppose this needs to be some sort of a loop, since a column may have several numbers, then more than one cell with zero, then more positive numbers. There are about 50 columns, and 30 rows of data. This would be quite simple with a formula, but I'd like to do it with VBA. How can I do this?
One column looks something like this. As an example, the first and second instance of zero should be changed to 16.4 & 16.4, then the zeros at the bottom should be changed to 12.2 & 12.2
Thanks in advance.
Jim
I have several columns populated with positive numbers, but some are zero. I'd like a VBA method to change the zero's to whatever number is in the cell directly above. I suppose this needs to be some sort of a loop, since a column may have several numbers, then more than one cell with zero, then more positive numbers. There are about 50 columns, and 30 rows of data. This would be quite simple with a formula, but I'd like to do it with VBA. How can I do this?
One column looks something like this. As an example, the first and second instance of zero should be changed to 16.4 & 16.4, then the zeros at the bottom should be changed to 12.2 & 12.2
16.4 |
0 |
0 |
12.2 |
0 |
0 |
17.85 |
Thanks in advance.
Jim