Excel VBA will not loop through worksheets (Exclude Worksheet) -


the macro appears loops through of worksheets fine now. however, there way can make macro not applied specific worksheet in workbook, applied other worksheets?

sub formatsheet()  dim ws worksheet  each ws in activeworkbook.worksheets     ws.activate         columns("a:j").select         selection.autofilter         columns("a:j").entirecolumn.autofit         selection             .horizontalalignment = xlcenter         end         activewindow             .splitcolumn = 0             .splitrow = 1         end         activewindow.freezepanes = true next ws  end sub 

i created dataset test out , found code worked fine. must related specific data/worksheets. see if 2 sheets works, or try making smaller sample on workbook , see if works. sorry i'm not more helpful.


Comments