VBA Find Next Non-Blank Row

FalconFlyer

New Member
Joined
May 18, 2015
Messages
30
A
B
C
D
E
1
ABC
4
15
600
2
89
100
5
3
5
150
8
4
DEF
10
5
20
5
15
10
22
6
200
15
15
7
GHI

<tbody>
</tbody>
I want to find a range of rows in Column B from the first non-blank to the last blank (B1:B3 and then B4:B6). With that range, I would like to sort by another column (for example, Column E), sort (B1:B3) by Column M then sort the next set. I am not sure where to start. I have tried looking into Find.. FindNext. If someone can point me in the right direction, I would be thankful. TIA
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
If you fill in the blanks in column B (which is easy to do via SpecialCells/Blanks) then you could sort by col B /col E / col M.
 
Last edited:
Upvote 0
If you fill in the blanks in column B (which is easy to do via SpecialCells/Blanks) then you could sort by col B /col E / col M.

That may be the route I have to go.

But I am not sure I am closer to figuring it out. I still have to sort in sets, i.e Row 2-5, Row 6-20, etc.

I appreciate your reply.
 
Upvote 0
  • To fill in the blanks in column B :
  • Select column B
  • On the Ribbon's Home tab, click Find & Select.
  • Click Go To Special.
  • In the Go To Special dialog box, click Blanks, then click OK.
  • Assuming B2 is the active cell, type =B1
  • Press Crtl+Enter
  • Select column B and copy/pastespecial/values
  • Then sort normally in the way you want (col B/col E/col M)
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,202
Members
448,554
Latest member
Gleisner2

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