Monday, 10 September 2012

Macro To Count No. Of Non Empty Cells In Desired Column And Display The Results In a Desired Cell

'Macro To Count No. Of Non Empty Cells In Desired Column And Display The Results In a Desired Cell
Sub COUNT4()
Dim X As Integer
Dim Y As Integer
Dim z As Integer
Dim a As String

On Error GoTo TPR:

z = InputBox("Enter Desired Col. No. To Find Count of  Non Empty Cells", "Find Count", "Enter Here")

a = InputBox("Enter Range Reference to Display Count Results", _
"Where to Disply Count Results ", "Enter Here As A1 or B12.....")

For X = 1 To 100

If Cells(X, z) <> "" Then
 Y = Y + 1
Range(a) = Y
End If

Next X
TPR:
End Sub

No comments:

Post a Comment

Follow Me by Email

ExcelKingdom-Popular Posts

ExcelKingdom-Random Posts