Unhide all Rows and Columns
Sub UnhideRowsColumns() Columns.EntireColumn.Hidden = False Rows.EntireRow.Hidden = False End Sub Unhide all Rows and Columns in excel: Instead of unhiding rows and columns on by
Sub UnhideRowsColumns() Columns.EntireColumn.Hidden = False Rows.EntireRow.Hidden = False End Sub Unhide all Rows and Columns in excel: Instead of unhiding rows and columns on by
Sub SaveWorkshetAsPDF() Dimws As Worksheet For Each ws In Worksheets ws.ExportAsFixedFormat _ xlTypePDF, _ “ENTER-FOLDER-NAME-HERE” & _ ws.Name & “.pdf” Next ws End Sub Save
Sub deleteBlankWorksheets() Dim Ws As Worksheet On Error Resume Next Application.ScreenUpdating= False Application.DisplayAlerts= False For Each Ws In Application.Worksheets If Application.WorksheetFunction.CountA(Ws.UsedRange) = 0 Then Ws.Delete
Sub lockCellsWithFormulas() With ActiveSheet .Unprotect .Cells.Locked = False .Cells.SpecialCells(xlCellTypeFormulas).Locked = True .Protect AllowDeletingRows:=True End With End Sub Protect all the Cells With Formulas with a
Sub SortWorksheets() Dim i As Integer Dim j As Integer Dim iAnswer As VbMsgBoxResult iAnswer = MsgBox(“Sort Sheets in Ascending Order?” & Chr(10) _ &
Sub DisablePageBreaks() Dim wb As Workbook Dim wks As Worksheet Application.ScreenUpdating = False For Each wb In Application.Workbooks For Each Sht In wb.Worksheets Sht.DisplayPageBreaks =
Sub ProtectWS() ActiveSheet.Protect “mypassword”, True, True End Sub If you want to protect your worksheet you can use this macro code. All you have to
Sub UnprotectWS() ActiveSheet.Unprotect “mypassword” End Sub UnProtect Worksheet If you want to unprotect your worksheet you can use this macro code. All you have to
Sub Resize_Charts() Dim i As Integer For i = 1 To ActiveSheet.ChartObjects.Count With ActiveSheet.ChartObjects(i) .Width = 300 .Height = 200 End With Next i End
Sub InsertMultipleSheets() Dim i As Integer i = _ InputBox(“Enter number of sheets to insert.”, _ “Enter Multiple Sheets”) Sheets.Add After:=ActiveSheet, Count:=i End Sub Excel
Sub ProtectAllWorskeets() Dim ws As Worksheet Dim ps As String ps = InputBox(“Enter a Password.”, vbOKCancel) For Each ws In ActiveWorkbook.Worksheets ws.Protect Password:=ps Next ws
Sub DeleteWorksheets() Dim ws As Worksheet For Each ws In ThisWorkbook.Worksheets If ws.name <> ThisWorkbook.ActiveSheet.name Then Application.DisplayAlerts = False ws.Delete Application.DisplayAlerts = True End If
Get organized with our free, customizable Excel templates
© 2023 xlsxtemplates all rights reserved