How to make sharedMaterial work when I duplicate an object?

Hey Guys!
You must have answered several of these questions, but all I want to know is how to make a material on a duplicated object change itself to another material which is on the original object. I am using a script to make a city with buildings of random heights. Here is a code snippet pertaining to setting the sharedMaterial.

for(int x = 0; x < BuildingHeight; x++)
				{
					var Cube = Instantiate(BuildingTransform) as GameObject;
					Cube.transform.position = new Vector3(BuildingPos.x, BuildingPos.y + BuildingScale.y * x * 2 , BuildingPos.z);
					Cube.isStatic = true;
//					Cube.rigidbody.isKinematic = false;
					Cube.tag = "Building";
					Cube.transform.parent = transform;
					Cube.renderer.sharedMaterial = BuildingTransform.renderer.sharedMaterial;
				}

The materials of the others don’t change when I change the material of the building transform object. I just need to know if I’m setting the shared material correctly? Can anyone tell me how to implement it for a simple duplicate operation and then for this script? Does sharedMesh come into play here?
Thanks.

Hey Guys, I used Neodrop’s script ‘Combine Children Extented’ to combine the children into one large mesh. This was able to bring the draw calls to a minimum(around 24 from 200). But be warned, this script will not be able to batch more than 64k vertices. Here is the link: http://forum.unity3d.com/threads/combine-children-extented-sources-to-share.37721/

Thanks Guys!