Monday, September 10, 2012

Macro To Count No.of Non Empty Cells In a Desired Column and Display the Results In a Desired Cell


Macro To Count the No.of Non Empty Cells In Desired Column and Display the Results In a Desired Cell
Sub Count_Non_Empty()
Dim X As Integer
Dim Y As Integer
Dim z As Integer
Dim a As String

On Error GoTo Label:

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
Label:
End Sub

Thanks,Tamatam

No comments:

Post a Comment

Hi User, Thank You for visiting My Blog. Please post your genuine Feedback or comments only related to this Blog Posts. Please do not post any Spam comments or Advertising kind of comments which will be Ignored.