Count non blank row from a particular row

p9j123

Active Member
Joined
Apr 15, 2014
Messages
288
Office Version
  1. 2013
Platform
  1. Windows
Hello,

Can someone assist me to identify a macro that will count non blank row from a particular row to the next blank row in the middle of the sheet. Sample below

[Column A]
[Row 1] Not Needed
[Row 2] Not Needed
[Row 3] Blank Cell
[Row 4] Needed
[Row 5] Needed
[Row 6] Needed
[Row 7] Needed

[Row 8] Blank Cell
[Row 9] Not Needed
[Rw 10] Not Needed
[Row 7] Not Needed

In the example above I want to count starting A4 to the next blank cell, so it should return 4.

Thanks in advance
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Not sure it matters, but something like this work?
Code:
Sub Macro1()
Dim WB As Workbook, WS As Worksheet, Rng As Range

Set WB = Workbooks("Sample.xlsx") ' Set Sample.xlsx to name of workbook you are working in
Set WS = WB.Sheets(1) 'Set to Worksheet index you are working on
Set Rng = WS.Range("A1", Cells(Rows.Count, 1).End(xlUp))
Set CE1 = Rng.Find("", Range("A1"))
Set CE2 = Rng.Find("", CE1)
MsgBox (CE1.Address & " and " & CE2.Address & " are empty: return - " & CE2.Row - (CE1.Row + 1))

End Sub
 
Upvote 0

Forum statistics

Threads
1,216,027
Messages
6,128,373
Members
449,445
Latest member
JJFabEngineering

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top