An earlier reply was very accurate. The moon over the time of its existence (made by a large bodied impact with the young earth that sent the earth's crust into space where forces formed it into the moon) has slowed the earth's spin - now at 1000 miles per hour. The earth's cycle was much shorter than 24 hours; shorter than 20. Much shorter. The moon also holds the earth much more stable in its wobbling axis - without it we would 'wobble' to an extent that life would be difficult to sustain. It does move further away every year and has been at about 1 1/2 inches per year. This is basically because even though it has slowed our spin, our gravity forces (because of that spin)- literally flings - it away. It will take a very, very long time before it leaves us significantly, maybe getting scooped up by Jupiter's gravitational field. It's questionable what will happen to the earth. However, the sun does have an expiration date: 2-4 billion years from now it will run out of fuel and become a white dwarf after first swelling and then collapsing in a spectacular event. Also, it's just possible that nearby Andromeda may collide with our galaxy first...so...perhaps the collision would change everything...
Thanx, there are some suppositions in your reply that are noteworthy for comment but on the whole I agree.
It will take a very, very long time before it leaves us significantly, maybe getting scooped up by Jupiter's gravitational field.
Two things here.
First is relative time. A long time for our relativity is not the same as a long time for the Earth or the Sun or the galaxy or the Universe. Relatively, the Moon will leave Earth's orbit in a short time considering the remaining life of our star and planet.
The second, Jupiter's gravitational influence is part of the whole system's gravitational signature. Our Moon may not be captured by Jupiter's gravity before the Sun ends. There is a whole lot of space from here to there. Additionally, just like a ball being spun on a string, the angle of exit and the velocity of the Moon in that trajectory will determine the Moon's direction. It could be flung towards the Sun. It could be released behind Earths orbital path at an angle that misses the intersecting orbits of other planets to become locked into a cometary orbit. It could crash into Mars or Venus. It could get flung into the asteroid belt initiating asteroid trajectories that could intersect Earth at some point in the future.
Andromeda may collide with our galaxy first...so...perhaps the collision would change everything...
Andromeda will merge with the Milky Way, not collide. Andromeda's Galactic black hole WILL collide with Sagittarius A (The Milky Way's galactic black hole) but it will do so only if the trajectories intersect. Most likely they will miss or glance one another and slowly orbit into each other.
Here are two model simulations:
http://youtu.be/4disyKG7XtU
http://youtu.be/PrIk6dKcdoU
Notice how the models show the galaxies acting fluid?
Each star has a bow shock that acts like a barrier of outward push. For a collision to take place the trajectory will need to penetrate those bow shocks and heliospheres at just the right trajectory and with just the right velocity to impact the stars at their centers. Kinda like a needle penetrating a cell.
The reason why we have a Moon is because it was not a direct impact with the Earth. It was a glancing impact.
Here is some simulations of Moon formation.
Note the fluid dynamics involved
http://www.youtube.com/watch?v=Jf628Bugy_I
http://www.youtube.com/watch?v=mQAdYWcA7ig
http://www.youtube.com/watch?v=Fwl_JBQtH9o
And a feature presentation
Birth of the Moon from the show, Cosmic Journeys
http://www.youtube.com/watch?v=WGTBJHFNywI