Credit cards

Would it be a bad idea to take out personal loan to consolidate credit cards ? Would it affect my credit ?