Clear Contents Merged Cells

melewie

Board Regular
Joined
Nov 21, 2008
Messages
188
Office Version
  1. 365
Platform
  1. Windows
Before I start yes I have merged cells!!! This was never meant to be used with macros, but the people have spoken and I dislike them :biggrin:<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"> <v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype><v:shape id=_x0000_i1025 style="WIDTH: 12pt; HEIGHT: 12pt" alt="0" type="#_x0000_t75"><v:imagedata o:href="http://www.mrexcel.com/forum/images/smilies/biggrin.gif" src="file:///C:\Users\U522393\AppData\Local\Temp\msohtmlclip1\01\clip_image001.gif"></v:imagedata></v:shape><o:p></o:p>
<o:p></o:p>
Problem I am having is I have a named range 'Populate_RNG' which covers exactly 1 gazillion cells and contains merged cells :mad: <v:shape id=_x0000_i1026 style="WIDTH: 11.25pt; HEIGHT: 11.25pt" alt="0" type="#_x0000_t75"><v:imagedata o:href="http://www.mrexcel.com/forum/images/smilies/icon_mad.gif" src="file:///C:\Users\U522393\AppData\Local\Temp\msohtmlclip1\01\clip_image002.gif"></v:imagedata></v:shape><o:p></o:p>
<o:p></o:p>
So the code
Code:
Range("Populate_RNG").ClearContents
doesn’t work!!<o:p></o:p>

<o:p></o:p>
Is there a way around this as reformatting the sheet would be a nightmare and I want to go home soon!<o:p></o:p>
<o:p></o:p>
Any help would be great<o:p></o:p>
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
This just worked for me:
Code:
Range("TestRange") = Null
Where TestRange is cells A1:G22 merged into one
 
Upvote 0
Are the merged areas overlapping cells outside of that named range by any chance?
 
Upvote 0
JackDanIce - Thanks allot that seemed to work, you are now my favourite person in the world!!

GlennUK - No all the merged cells are 'input' cells so they dont overlap all are contained within the range? should this normally work with merged cells?
 
Upvote 0
It worked for me. Weird, huh.


I will double check when I get chance like I said the range does contain 1 gazillion cells so to be honest I didnt really check for that....I just saw merged cells and blamed them, they normaly cause all the worlds problems:biggrin:
 
Upvote 0
It's very weird though ... it crashed first time, then worked the second time ( and 3rd and 4th and for all other tests until I had merged cells overlapping the edge of the range ).
 
Upvote 0
It's very weird though ... it crashed first time, then worked the second time ( and 3rd and 4th and for all other tests until I had merged cells overlapping the edge of the range ).

Strange....I going to blame merged cells they are the work of the devil! Every time you merge cells a programmer somewhere dies :biggrin:
I will have a play tomorrow and see what happens :confused:
 
Upvote 0
Strange....I going to blame merged cells they are the work of the devil! Every time you merge cells a programmer somewhere dies :biggrin:
I will have a play tomorrow and see what happens :confused:

... oh yes indeed!!!! :-D
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top