What happens first Sun Red Giant or Andromeda collision?
Fate of the Solar SystemSee also: Formation and evolution of the Solar System § Galactic collision and planetary disruption
Two scientists with the Harvard–Smithsonian Center for Astrophysics stated that when, and even whether, the two galaxies collide will depend on Andromeda's transverse velocity. Based on current calculations they predict a 50% chance that in a merged galaxy, the Solar System will be swept out three times farther from the galactic core than its current distance. They also predict a 12% chance that the Solar System will be ejected from the new galaxy sometime during the collision. Such an event would have no adverse effect on the system and the chances of any sort of disturbance to the Sun or planets themselves may be remote.
Excluding planetary engineering, by the time the two galaxies collide, the surface of the Earth will have already become far too hot for liquid water to exist, ending all terrestrial life; that is currently estimated to occur in about 3.75 billion years due to gradually increasing luminosity of the Sun (it will have risen by 35–40% above its current luminosity).
I've seen an astronomer on tv last night who said that the oceans will be vaporized in about 1 billion years from now. However, it was a rather informal remark, not an exact calculation.By chance, there is a section in Wikipedia that directly addresses your question. It seems that the bottom line is "by the time the two galaxies collide, the surface of the Earth will have already become far too hot for liquid water to exist, ending all terrestrial life; that is currently estimated to occur in about 3.75 billion years "