There is no good direct connection between Alexandria and the Pyramids of Giza by public transport. You could take a bus, but that is not a good option. What follows is a roadmap to take to reach the Pyramids by public transport from Alexandria.
Take the train from Alexandria to Cairo
At the train station in Cairo you will find the metro station Mubarak. Take metro line N° 2 to Giza train station. You arrive there after 10 minutes and you will pay 50 piastres per person.
Walk to the large Avenue Al Ahram, located 100 meters away from the station. There you can take bus N° 900 or 997 wich will make a stop near the Pyramids. The journey takes about 15 minutes and costs 50 piastres per person.
At first sight it may seem confusing and difficult, but it's not that hard to do.
TIP: You can also use variants. Step 1 remains always the same, but you can eg take a from the train station in Cairo to the Pyramids (LE30-50 by taxi). You can take the (line 1 or 2) to the Egyptian Museum (Sadat Station) and walk to the nearby bus terminal. There you can also take bus N° 900 and 997. It's also possible to catch the tourist bus N° 355 or 357 of CTA (Cairo Transport Authority). You will pay LE2 per person (one way).