Use Quaternion.lookat to rotate On One Axis (for turret.)

Hi gang, here is what I’m working on for my Automatic Gun-turret control system.
I can select a random target with tag and when it gets out of range it try to find a new target Cool,
'my problem now is when i try to use Quaternion.lookat I cannot seem to get it to lock on Axis

using UnityEngine;
using System.Collections;

public class TurretTargeting : MonoBehaviour {

	public GameObject Target;
	public GameObject TurretBarrels;
	public GameObject TurretHead;
	public GameObject[] Targets;
	public bool OurTeam;
	public 	float distance;
	public int index;

	public void LateUpdate(){

		 distance = Vector3.Distance(Target.transform.position, transform.position);


		// If the turret is ours........
		if(OurTeam == true){
			if (Target == null){		
				Targets = GameObject.FindGameObjectsWithTag("TeamTwo");
				index = Random.Range (0, Targets.Length);
				Target = Targets[index];
			}
		}
		// If the turret is ours........



		// If the turret is NOT ours........
		if(OurTeam == false){
			if (Target == null){		
				Targets = GameObject.FindGameObjectsWithTag("TeamOne");
				index = Random.Range (0, Targets.Length);
				Target = Targets[index];
			}
		}

		// If the turret is NOT ours........


			// Universal Targeting Range.
			if(distance > 100){
				Target = null;
			}




		// TurretBarrels ROATATE OON VERTICAL AXIS ONLY.

		// TurretHead Rotate horizontal axis only.


	}
}

Sidenote…
Your positioning of the Distance formula is weird… This is what your saying “Find the Distance, then select a random enemy, then test to see if the distance is more…” Don’t know if you were trying to do that or not

Back to your Question
Here’s a bit of code that would work (With Explanation)
Would be put where you want to rotate the turret

if (Target != null) {
        // Saves it's current rotation, turns to target, records rotation, and reverts to original rotation immediately. All in one update so it should not show it looking at the target and looking back
    
        Quaternion CurrentRotation = transform.rotation;
        transform.LookAt(Target.transform.position);
        Quaternion GoalRotation = transform.rotation;
        transform.rotation = CurrentRotation;
    
        // Makes Goal Rotation only save it's y value and set the current rotation's y value to the current rotation
        // This can be Changed... The way to do that is to put in "GoalRotation" for all the axis that you want to change, and "CurrentRotation" for those that you don't want changed

        GoalRotation = new Quaternion (CurrentRotation.x, GoalRotation.y, CurrentRotation.z, CurrentRotation.w);
        
    
        float Speed = 1.0f;
        transform.rotation = Quaternion.RotateTowards (CurrentRotation, GoalRotation, Speed);

    }