UncleBajubjubs
Board Regular
- Joined
- Jul 11, 2017
- Messages
- 111
- Office Version
- 2010
Hello, I made a macro to go through a long worksheet and clear out all the entries in certain cells, using the following example code
<Code>
Range("G297").Clear
Range("R297").Clear
Range("D298").Clear
Range("L298").Clear
Range("S298").Clear
Range("D299").Clear
</code>
I did this for hundreds of cells, typing in the cells I needed to clear, as this sheet will be filled in and cleared regularly. I got tunnel vision while working on this and forgot that all the cells to be cleared are merged, and thus I get the error "Cannot change part of a merged cell". Is there any easy way to fix this, or will I have to go to each of the cells, and make them unmerge and then merge again after they are cleared? Since there's hundreds of them, that'd take a while to type, so I'm hoping there's another way.
Thanks.
<Code>
Range("G297").Clear
Range("R297").Clear
Range("D298").Clear
Range("L298").Clear
Range("S298").Clear
Range("D299").Clear
</code>
I did this for hundreds of cells, typing in the cells I needed to clear, as this sheet will be filled in and cleared regularly. I got tunnel vision while working on this and forgot that all the cells to be cleared are merged, and thus I get the error "Cannot change part of a merged cell". Is there any easy way to fix this, or will I have to go to each of the cells, and make them unmerge and then merge again after they are cleared? Since there's hundreds of them, that'd take a while to type, so I'm hoping there's another way.
Thanks.