Zshadowman
New Member
- Joined
- Oct 19, 2005
- Messages
- 4
Hello,
I just can not seem to get this right. I'm on Excel 2003 and have a macro to fill in blank cells with the value from the cell above it. Now I need a macro to undo this. There may be 1 or 2 cells or as many as 12 cells in sequence that were filled with the same value (ie: B12,B13,B14,B15,B16, are filled from B11 value, B18,B19 are filled from B17 value, B21,B22,B23 are filled from B20 value, and so on) . I need to leave the top/beginning value and return the filled cells to blanks.
If I just reverse the fill macro it skips everyother cell because it "blanks" the first duplicate and then when it moves down to next cell (which reads equal to the "fill" cell source which is now 2 rows up) but the macro is comparing to the cell it just set to blank.
Here is original "fill" macro. Please help me figure out the correct undo macro that will leave only the top/beginning value in each random group.
Thanks a bunch... here is macro...
Sub FillCellfromAboveCell()
For Each Cell In Range("B9:B200")
If Cell.Value = "Stop" Then Exit Sub
If UCase(Cell.Value) = "" Then Cell.Value = Cell.Offset(-1, 0)
Next Cell
End Sub
I just can not seem to get this right. I'm on Excel 2003 and have a macro to fill in blank cells with the value from the cell above it. Now I need a macro to undo this. There may be 1 or 2 cells or as many as 12 cells in sequence that were filled with the same value (ie: B12,B13,B14,B15,B16, are filled from B11 value, B18,B19 are filled from B17 value, B21,B22,B23 are filled from B20 value, and so on) . I need to leave the top/beginning value and return the filled cells to blanks.
If I just reverse the fill macro it skips everyother cell because it "blanks" the first duplicate and then when it moves down to next cell (which reads equal to the "fill" cell source which is now 2 rows up) but the macro is comparing to the cell it just set to blank.
Here is original "fill" macro. Please help me figure out the correct undo macro that will leave only the top/beginning value in each random group.
Thanks a bunch... here is macro...
Sub FillCellfromAboveCell()
For Each Cell In Range("B9:B200")
If Cell.Value = "Stop" Then Exit Sub
If UCase(Cell.Value) = "" Then Cell.Value = Cell.Offset(-1, 0)
Next Cell
End Sub