Does changing hosting affect my ranking?
No. Your webhosting does affect your rankings. You can change hosts without it affecting your rankings. The only issue you may run into is if you fail to make a smooth transition to your new webhost. Downtime will naturally prevent the search engine crawlers from crawling your site properly. Extended downtime may cause indexing issues.
To switch hosts properly follow these easy steps:
1) Set up your website on your new webhost
2) Change your DNS to point your domain name to your new webhost
3) Leave the website up on the old server for at least one week to make sure DNS has propagated completely. After one week you can safely take down the site from the old server.
The most common mistake users make when switching hosts is not leaving the old site up while DNS propagates. Make sure you don't wait until the last minute when switching hosts or you may run into trouble.