Advanced Excel Tips-Macros/VBA

Advanced Excel Tips-Macros/VBA

Share

28/11/2020

Q : Disable Page Breaks
Ans :
Sub DisablePageBreaks()
Dim wb As Workbook
Dim wks As Worksheet
Application.ScreenUpdating = False
For Each wb In Application.Workbooks
For Each S*t In wb.Worksheets
S*t.DisplayPageBreaks = False
Next S*t
Next wb
Application.ScreenUpdating = True
End Sub

28/11/2020

Q: Save Each Worksheet as a Single PDF
Ans :
Sub SaveWorkshetAsPDF()

Dim ws As Worksheet

For Each ws In Worksheets ws.ExportAsFixedFormat xlTypePDF, "D:\LG\" & ws.Name & ".pdf"
Next ws
End Sub

This code will simply save all the worksheets in a separate PDF file. You just need to change the folder name from the code.

28/11/2020

Q : Unhide all Rows and Columns
Ans :
Sub UnhideRowsColumns()
Columns.EntireColumn.Hidden = False
Rows.EntireRow.Hidden = False
End Sub

Want your school to be the top-listed School/college in Pune?
Click here to claim your Sponsored Listing.

Category

Address


Pune