2016-10-09 12 views
1

Was ich erreichen möchte, ist das Zählen von nicht leeren Zellen in Zeile lRow. Ich habe Fehler in der dritten Zeile des Makros. Ich habe keine Ahnung, wie ich das beheben kann.Zähle nicht leere Zellen in Zeile x

Sub CountNonEmptyCells() 

    lRow = Cells(Rows.Count, 1).End(xlUp).Row 

    Rows(lRow).SpecialCells(xlCellTypeConstants, 23).Cells.Count 
    MsgBox lRow 

End Sub 
+1

'MsgBox WorksheetFunction.CountA (Zeilen (lRow))' https://msdn.microsoft.com/en-us/library/office/ff838049 – Slai

Antwort

1

geschweige denn, ich es selbst festgelegt:

Sub CountNonEmptyCells() 

    lRow = Cells(Rows.Count, 1).End(xlUp).Row 

    x = Rows(lRow).SpecialCells(xlCellTypeConstants, 23).Cells.Count 
    MsgBox x 

End Sub