Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.
Public Sub Sum_Rows_and_Columns(StartCol As Integer) Dim lngRowCount As Long Dim lngColCount As Long Dim strFormula As String On Error GoTo ProcError Set xl = GetObject(, "Excel.application") Set wbk = xl.activeworkbook Set sht = wbk.activesheet lngRowCount = sht.usedrange.rows.Count lngColCount = sht.usedrange.columns.Count Set rng = sht.Range(sht.cells(2, lngColCount + 2), sht.cells(lngRowCount, lngColCount + 2)) strFormula = "=Sum(RC[" & StartCol - (lngColCount + 2) & "]:RC[-2]" rng.Formula = strFormula rng.NumberFormat = "#,###.00" rng.Errors(5).Ignore = True '5=xlOmittedCells sht.columns(lngColCount + 2).Entirecolumn.autofit ProcExit: On Error Resume Next Set sht = Nothing Set wbk = Nothing Set xl = Nothing Exit Sub ProcError: MsgBox "Sum_Rows_And_Columns" & vbCrLf & Err.Number & vbCrLf & Err.Description Debug.Print "Sum_Rows_And_Columns", Err.Number, Err.Description Resume ProcExit End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.