hi saquibansari,
this is a little difficult to follow what you're trying to accomplish. it sounds like you have code that is working correctly, but you want it to run on all worksheets in the workbook, is that correct? you should be able to wrap it in a for loop like this:
it also sounds sorta like you don't want to copy and paste it into each new workbook, is that correct? the best solution will be to add this to your personal macro workbook. doing so will make that macro available every time you open excel.
https://support.office.com/en-nz/art...0-6e4c3f5ee566
be careful here - i wrote "for each worksheet in activeworkbook..." you will need to be sure you've selected the workbook on which you want this code to run before running that macro. make sense?
Bookmarks