setting slider value from variables

Hi there guys

I have a slider type (class) that stores the basic properties of a horizontal slider. I made this because my users create sliders and assign them to variables. Now all is working fine for that part, but I’m having some issues updating the positions of the sliders with the values of the variable is has been linked to - each slider can only control one variable. The variables are only floats and vector3s and are stored in dictionaries in a userFormulas class. Can anyone please help me with this?

Thanks, here is the main part of the code for the slider

void OnGUI()
    {

        foreach (Slider slider in sliderList)
        {
            GUI.BeginScrollView(new Rect(440, 100, 160, 500), scrollPosition, new Rect(0, 0, 140, 600));
            GUILayout.BeginHorizontal();

            GUILayout.Label(slider.Label);
            slider.Value = GUILayout.HorizontalSlider(slider.Value, slider.MinValue, slider.MaxValue, GUILayout.MinWidth(70),GUILayout.MaxWidth(70), GUILayout.Height(35));
            GUILayout.Label(slider.Value.ToString());


            //which slider controls what vector3 variable
            for (int i = 0; i < vector3Variable.Count; i++)
            {
                Vector3 curVector3 = new Vector3(userFormulas.userVector3[vector3Variable[i].Trim()].x, userFormulas.userVector3[vector3Variable[i].Trim()].y, userFormulas.userVector3[vector3Variable[i].Trim()].z);

                if (slider.Label == vector3ControlX[i].Trim())
                {
                    userFormulas.userVector3[vector3Variable[i].Trim()] = new Vector3(slider.Value, curVector3.y, curVector3.z);
                }
                
                else if (slider.Label == vector3ControlY[i].Trim())
                {
                    userFormulas.userVector3[vector3Variable[i].Trim()] = new Vector3(curVector3.x, slider.Value, curVector3.z);
                }
                else if (slider.Label == vector3ControlZ[i].Trim())
                {
                    userFormulas.userVector3[vector3Variable[i].Trim()] = new Vector3(curVector3.x, curVector3.y, slider.Value);
                }
            }

bump

any ideas?