I would like to sum the values in the NOMINAL_MAX column and then copy them. My code below is applying filters, I wish it would only sum if it finds a column name. Does anyone know how to transform this code?
VBA Code:
With wbMe.Sheets("pochodne")
.AutoFilterMode = False
With .Range("A1:AD1")
cIndex = Application.Match("NOMINAL_MAX", .Rows(1), 0)
If IsNumeric(cIndex) Then
.AutoFilter Field:=1, Criteria1:="NOMINAL_MAX"
wbMe.Sheets("pochodne").Range("Q42").Value = Application.Sum(Intersect(.SpecialCells(xlCellTypeVisible), .Columns(cIndex)))
End Sub