if you want to count the non blank rows and non blank cells in a sheet.
Here is the code-
Sub count_non_blank_rowsand_cells()
Dim i As Long
For i = 1 To Sheets(1).Range("a1").SpecialCells(xlLastCell).Row
If Application.WorksheetFunction.CountA(Sheets(1).Rows(i & ":" & i)) > 0 Then
k = k + 1
End If
Next i
MsgBox "Non -Blank Rows --------> " & k
MsgBox "Non -Blank Cells --------> " & Application.WorksheetFunction.CountA(Sheets(1).UsedRange)
End Sub
Subscribe to:
Post Comments (Atom)
Import data from SQL
Macro to import data from SQL using ADO connection string: Sub Import_data_from_SQL() ' Tools -> References -> Microsoft Active...
-
If you want to add a new menu on mouse right click "Workbook Navigation showing you the list of all open workbooks and worksheets in ea...
-
Macro to Export Range in Json Format Option Explicit Sub export_in_json_format() Dim fs As Object Dim jsonfile Dim rangetoex...
No comments:
Post a Comment