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

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
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,223,248
Messages
6,171,011
Members
452,374
Latest member
keccles

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