Version: Excel 2010

Hi,

I need to create a macro which loops over a range of cells and removes extra underscores from the cell contents. It would be nice if the macro could also remove any underscores that appear before and after the brackets. E.g. :

ab_c becomes ab_c
ab__c becomes ab_c
a____________________b__c becomes a_b_c
(_abc) becomes (abc)
(ab__c_____) becomes (ab_c)

I am having trouble figuring out how to do this, any help from the experts would be much appreciated!

Thanks!!

Dan