Can someone help Cleanup my recorded macro
I was wondering if some one could look at this and clean it up so its more
better. I dont know excel very good I recorded the macro and if the excel file changes in pretty much any way then the macro error. Application.Run "'Points Tracker.xls'!UnprotectAll" Columns("H:AK").Select Selection.EntireColumn.Hidden = True Range("A4:AM104").Select Range("AM4").Activate Selection.Sort Key1:=Range("AM4"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal Range("A4").Select With ActiveWorkbook.PublishObjects("Nitro Points Tracker_23684") .HtmlType = xlHtmlStatic .Publish (False) .AutoRepublish = False End With Range("A4:AM104").Select Selection.Sort Key1:=Range("A4"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal Range("A4").Select Selection.EntireColumn.Hidden = False Cells.Select Selection.EntireColumn.Hidden = False Range("A4").Select Sheets("eigth_sportsman").Select Columns("H:AK").Select Selection.EntireColumn.Hidden = True Range("A4:AM104").Select Range("AM4").Activate Selection.Sort Key1:=Range("AM4"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal Range("A4").Select With ActiveWorkbook.PublishObjects("Points Tracker_29286") .HtmlType = xlHtmlStatic .Publish (False) .AutoRepublish = False End With Range("A4:AM104").Select Selection.Sort Key1:=Range("A4"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal Cells.Select Selection.EntireColumn.Hidden = False Range("A4").Select Sheets("arena_truck").Select Columns("H:AK").Select Selection.EntireColumn.Hidden = True Range("A4:AM104").Select Range("AM4").Activate Selection.Sort Key1:=Range("AM4"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal Range("A4").Select With ActiveWorkbook.PublishObjects("Points Tracker_30097") .HtmlType = xlHtmlStatic .Publish (False) .AutoRepublish = False End With Range("A4:AM104").Select Selection.Sort Key1:=Range("A4"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal Cells.Select Selection.EntireColumn.Hidden = False Range("A4").Select Sheets("monster_truck").Select Columns("H:AK").Select Selection.EntireColumn.Hidden = True Range("A4:AM104").Select Range("AM4").Activate Selection.Sort Key1:=Range("AM4"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal Range("A4").Select With ActiveWorkbook.PublishObjects("Points Tracker_30829") .HtmlType = xlHtmlStatic .Publish (False) .AutoRepublish = False End With Range("A4:AM104").Select Selection.Sort Key1:=Range("A4"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal Cells.Select Selection.EntireColumn.Hidden = False Range("A4").Select Sheets("stadium_truck").Select Columns("H:AK").Select Selection.EntireColumn.Hidden = True Range("A4:AM104").Select Range("AM4").Activate Selection.Sort Key1:=Range("AM4"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal Range("A4").Select With ActiveWorkbook.PublishObjects("Points Tracker_31534") .HtmlType = xlHtmlStatic .Publish (False) .AutoRepublish = False End With Range("A4:AM104").Select Selection.Sort Key1:=Range("A4"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal Cells.Select Selection.EntireColumn.Hidden = False Range("A4").Select Sheets("eigth_scale").Select Range("A4").Select Application.Run "'Points Tracker.xls'!ProtectAll" ActiveWorkbook.Save |
All times are GMT +1. The time now is 04:58 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com