VBA How to SUM result in last Row in columns (A:A)

  • Dear
    I would like to edit code
    At I can find Last Raw already but How to sum at Columns("A:A")

    Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Select
    ActiveCell.FormulaR1C1 = "=SUM(A:A" & LastRow & ")"

    Please ad visor because not working
    I am beginner

  • Code assumes A1 is Header so starts sum from A2

  • Thank you krab So I have many columns A,B,C,D,E,F==>O
    How I set

    Sub selectlastemptyrow()
    Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Select ' row,colum

    Cells(Rows.Count, 2).End(xlUp).Offset(1, 0).Select ' row,colum
    Cells(Rows.Count, 4).End(xlUp).Offset(1, 0).Select ' row,colum
    Cells(Rows.Count, 6).End(xlUp).Offset(1, 0).Select ' row,colum
    End Sub

  • change the ":F" to your last column

  • Dear All
    I would like to copy some and many columns in TG.xlsx file to V1Sum.xlsm how I do
    Thank you krab

    Private Sub CommandButton2_Click()
    Dim TGColumn As Range, V1SumColumn As Range
    Set TGColumn = Workbooks("TG.xlsx").Worksheets("Sheet1").Columns("A")=======> I need Colume A,B,E,F,G,J,K,AJ,AQ,AU some columns to need copy
    Set V1SumColumn = Workbooks("V1Sum.xlsm").Worksheets("3G").Columns("A")====>How I do

    TGColumn.Copy Destination:=V1SumColumn

    End Sub

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!