Advanced Excel Tips-Macros/VBA
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
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.
Q : Unhide all Rows and Columns
Ans :
Sub UnhideRowsColumns()
Columns.EntireColumn.Hidden = False
Rows.EntireRow.Hidden = False
End Sub
Click here to claim your Sponsored Listing.
Category
Contact the school
Address
Pune