Carry Down Multiple Rows of Data to End of Specific Section

jski21

Board Regular
Joined
Jan 2, 2019
Messages
155
Office Version
  1. 2016
Platform
  1. Windows
Good morning Mr. Excel Team,

I have a rather lengthy spreadsheet downloaded from a program that forsakes any and all friendliness to a workable Excel format. I've got some code to deal with most of the issues but having a bit of trouble with this one. Here's a snapshot:

PR 05 - Drawdown Report 10.1.21.xlsx
ABCDEFGHIJKL
1Program YearProjectProject # Activity NameVoucherLine ItemVoucher StatusLOCCS Send DateStart YearProjectCodeTypeDrawn Amount
22015A13613ABC58795721Completed12/21/20152015B15MC390004EN$419,000.00
32015
42015
52015
62015B13627DEF58952041Completed2/10/20162015B15MC390004PI$170,384.50
72015B13627DEF59862341Completed11/23/20162015B15MC390004EN$313,014.25
82015B13627DEF60127453Completed2/17/20172015B15MC390004EN$1,200.00
92015B13627DEF60145552Completed2/22/20172015B15MC390004EN$62,399.50
102015
112015
122015
132015
142015G13604HIJ58795616Completed12/21/20152015B15MC390004EN$326,290.00
15201558822261Completed12/30/20152015B15MC390004EN$98,338.00
16201558822291Completed12/30/20152015B15MC390004EN$486,150.00
17201559039602Completed3/8/20162015B15MC390004EN$2,152.01
18201559862344Completed11/23/20162015B15MC390004EN$115,917.99
19201561309911Completed3/8/20182015B15MC390004EN$33,465.00
20201561657881Completed6/25/20182015B15MC390004EN$71,204.00
21201561796761Completed8/9/20182015B15MC390004EN$119,000.00
22201564707352Completed3/11/20212015B15MC390004EN$600.00
PR 05 - Drawdown Report by (2


Essentially, I'm seeking to fill in the rows below in Columns B, C, and D with the copied data from the initial row of the line item. An example of this completed exercise is in Row 6 - Row 9. The initial row is Row 6 and that information is copied down all the way to the end of that section, which is E9.

An uncompleted section resides in Row 14. The data in B14, C14, and D14 would need to be copied down to the end of its section, which would be E22. And so on, and so on, until the end of the mess in the very last row which will be dynamic as additional data is added.

Notice some of the rows are single entries and that is ok. It's the multiple entry rows (2 or more) that give me heartburn. The goal is to eventually have a flat file or table I can work with.

I'll need to eliminate all the spaces once all the data is filled. Any simple method to do that would be appreciated as well. I have some code to do that but I believe it's rather awkward as it takes a bit of time to run.


Thanks in advance for any assistance. I always come away from this forum with a bit more knowledge about Excel and VBA.


Regards,

jski
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Code removed, I misunderstood the question.
 
Upvote 0
How about
VBA Code:
Sub jski()
   Dim Rng As Range
   
   For Each Rng In Range("G2", Range("G" & Rows.Count).End(xlUp)).SpecialCells(xlConstants).Areas
      On Error Resume Next
      With Rng.Offset(, -5).Resize(, 3)
         .SpecialCells(xlBlanks).Formula = "=r[-1]c"
         .Value = .Value
      End With
      On Error GoTo 0
   Next Rng
End Sub
 
Upvote 0
Solution
Wow...that worked swiftly and did the job. Thanks Fluff! A few questions if I may:

1. What is .SpecialCells(xlConstants.Areas?
2. What is "=r[-1]c"?
3. Why G2 instead of E2?
 
Upvote 0
1) The special cells finds all cells that are constants & each group of contiguous cells is an area.
2) it's R1C1 notation & in this case means the row above.
3) No particular reason.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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