o We modify any of the properties of the Page Setup object in a VBA macro.Refer to this Microsoft article for more details - Use 'WITH' statement when working with objects: If we have to access an object's properties and methods in several lines, we must avoid using object's name or fully qualified object path again and again. Without a good logic, a good written VBA macro program has no value. Analyze the logic: Before optimizing the syntax, pay more attention in optimizing the logic. Calculation = xl Calculation Manual Stop Events: Use Application. You may turn off the automatic calculation using Application.
Enable Events to tell VBA processor whether to fire events or not. Avoid 'Screen Flickering' or 'Screen Repainting': Use Application. So streamline your program logic and get the best performance of macros.I'm trying to speed up my VBA code and am not sure how to do it.The slowest task by far is my loop to hide empty rows. Value = "") Next cell End Sub Public Sub Unhide Rows(list1 As Range) Dim cell As Range For Each cell In list1 If (cell.