Merge below blank cells with filled one

sushilkadam

New Member
Joined
Mar 14, 2016
Messages
14
I want to merge the below blank cells with the upper cell data.

For example my data is as below

A1
Doc 01
A2

A3

A4
Doc 02
A5

A6

A7

A8
Doc 03
A9

A10


<tbody>
</tbody>

I have got a code for merging every nth row but the problem is my data is uncertain, I mean blank cells are after 3RD row or may be after 4th or 5th row.
In above example
A1 to A3 is Doc 01 (total 03 rows)
A4 to A7 is Doc 02 (total 04 rows)

I want to vba code to get the below result

I require it as below

Doc 01


Doc 02


Doc 03



<tbody>
</tbody>

Can anyone tell me how can I put the range of cells to be taken in calculation?
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,214,971
Messages
6,122,520
Members
449,088
Latest member
RandomExceller01

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