I am using the following code which I found in google and its working good if I open blank sheet1 workbook, open the macro, paste this code and run it.
But its not working if I save this macro as add-in and open another excel, run this add-in.
I guess there is something to do with ThisWorkbook...