Skip to content

Tag Archives: Excel

Cell Reference to Excel Header / Footer [Only VBA will do]


The only way: use a VBA macro. E.g. ActiveSheet.PageSetup.LeftFooter = "Check: " &  Sheets(SETTINGS_SHEET_NAME).Range("F4").Value

Line Break in Excel Header / Footer via Macro


Using VBA, add line break to header or footer with Chr(13). E.g. ActiveSheet.PageSetup.LeftFooter = "Foo bar" & Chr(13) & "Another line"

[Excel] Recalculate Sheets on Workbook Open (Using VBA)


Add to ThisWorkbook->Workbook code. Private Sub Workbook_Open() Dim oSht As Worksheet Dim xlCalc As XlCalculation On Error GoTo ErrorHandler 'remember the user's calculation setting before setting it to manual xlCalc = Application.Calculation Application.Calculation = xlCalculationManual For Each oSht In Worksheets oSht.EnableCalculation = False oSht.EnableCalculation = True Next oSht Application.Calculate ErrorExit: On Error Resume Next 'restore […]

[Excel] Days in Month


=DAY(DATE(YEAR(A1);MONTH(A1)+1;1)-1) , where A1 contains a valid date.