Home sum cell based on lower case (Case sensitive) letter?
Reply: 0

sum cell based on lower case (Case sensitive) letter?

user1027 Published in May 20, 2018, 12:00 pm

I am writing a program that should sum only the row with a lower case c. The code I have now, sums all rows beginning with c, regardless if upper or lower case. How I can I write it so that it is case sensitive? Here is what I have so far:

Sub summ()
Dim iArea As Long

With Worksheets("K00304.RPT")
    With .Range("A14", .Cells(.Rows.Count, 1).End(xlUp))
        .Cells(2, 1).Value = "ZERO"
        .AutoFilter field:=1, Criteria1:="ZERO*"
        With .Resize(.Rows.Count - 
1).Offset(1).SpecialCells(xlCellTypeVisible) '.Offset(-1)
            For iArea = 1 To .Areas.Count - 1
                With .Parent.Range(.Areas(iArea).Offset(1), .Areas(iArea + 
"AF").End(xlUp).Offset(1).Value = WorksheetFunction.SumIf(.Cells, "c*", 
.Offset(, 7))
                End With
        End With
        .Cells(2, 1).ClearContents
    End With
    .AutoFilterMode = False
End With

Many Thanks!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.256718 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO