controlling 6 stepper motors from PC using arduino mega

I haven't studied you code closely but it seems at first glance that the code in each CASE statement is the same except that it addresses a different motor.

Wouldn't it be much easier to have a single version of that code in a function that is called with the appropriate motor ID as a parameter. And instead of directionPin1, directionPin2 etc, but those items in an array.

I strongly suspect that you are going to have to replace delay(millisBetweenSteps) with the Blink Without Delay technique. Using delay() is fine for a simple demo but it will hardly be appropriate with 6 motors.

If you put the motor code in a single function and if the motor IDs and other parameters are in arrays it will be easy to arrange it so that any or all motors just move a single step for each iteration of loop. Which also seems more appropriate when you have multiple motors.

...R