Said Mohammed bin AbeeBakr Abdulqader al-Razee, in his book "Mukhtar al-Sihah" one of the classic Arabic-wordbooks:
The meaning of subhanallah is, making Allah pure, and it is bound to its original word (sabh, meaning void) as if he said, I verily absolve Allah from all evil.
The origin for the word is sabh, voidness, or tasbeeh, making something void. So the direct literal meaning of the phrase is Allah is void... And there is a part that is unpronounced which is "void of all evil". And this is the way that it is used in the Quran. For example it says; "Subhanallah amma yasiffon - Void/Free is Allah from that (evil) which they ascribe (to Him)" and "Subhanalla amma yoshrikoon - Free is Allah from those polytheistic deeds that they do."
And the word subhan does not come from the word sabaha as one said. It only happens to have the root-letter s.b.h.
The statement of "Subhan'allah" testifies one's removing any anthropomorphic elements or associations with God, as al-Razi says in his Mukhtar al-Sihah, (تنزيه tanziyh).