Stepper motor vibrates but doesnt turn

That snippet does not tell us the step rate (speed) that you are trying to achieve.
Your snippet does not tell us what library, if any, that you are using.

As usual, the snippets of code leave out important information. That is why we request that you post the whole program. Read the forum guidelines to see how to properly post code and some information on how to get the most from this forum.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.