Translate an object with a button - C#

I have an object and I want that with a single press of a button, it goes from point A to point B. In the Update function I created different if statements to test which button is pressed.

In these if statements, I used the GetKeyDown fuction to move the object and it works very well when I hold down a button (the left arrow for example).

But I want the object's translation from point A to point B with a single press of the left button over a certain amount of time. If I use GetKey the object doesn't move from point A to point B automatically, but it moves only of few units.

public class Movement: MonoBehaviour 
{
 public Transform cube;
 public Transform target;

 public int speed; //I can change it in the Inspector

 void Update() 
 {

      float amtToMove = speed * Time.deltaTime;

      if (Input.GetKey("left"))
      {
           transform.position = Vector3.Lerp(cube.position, target.position, amtToMove);
      }
 }
}

Sorry for the bad english.

Can anyone help me?

void Update()
{
  if (Input.GetKeyDown("a"))
    GameObject.Find("ObjectA").transform.position = newPosition;
}

I could be wrong but you might want to look into Vector3.Lerp on Input.GetKeyDown

public class LerpExample: MonoBehaviour 
{
     public Transform start;
     public Transform end;
     public bool move = Input.GetKeyDown("a");
     public float amtToMove = speed * Time.deltaTime;

     void Update() 
     {
          if (move)
          {
               transform.position = Vector3.Lerp(start.position, end.position, amtToMove);
               if(start.position == end.position)
               {
                   move = false;
               }
          }
     }
 }

That allows you to move between the two positions over a certain amount of time if I'm correct. Have not tested the code, but I think it should work.

Hope that helps.

Hans

EDIT: Updated the code a bit