How to set the name of a gameObject

I've a script where I want to change the shader of a gameObject which name I've stored in a variable (=selectedObject).

this should be done with

<selectedObject>.renderer.material.shader = shader2;

So I need a way to tell that it is the shader of the gameobject whos name is contained in selectedObect that needs to be changed. So I need the correct syntax in front of ".renderer...."

Any help would be greatly appreciated!

Something like this:

GameObject.Find(selectedObject).renderer.material.shader = shader2;