Blank cells below to copy top cell until the next change

Mikey mike

New Member
Joined
Jul 8, 2013
Messages
6
Please see below data pulled off a system.
Data gives a date and time which I converted to simply HOUR and then the transaction figures. As seen in C2 and C3 there were two transaction amounts (16.76 and 15.00 ) at 09:23:02.
Problem is when I want to create a pivot to see total transaction amount by hour it wont take into account the 15.00 because there is no hour next to it.

Any suggestions? There are thousands of transaction amounts to sit there and copy paste each each ones hour. The below is the very small version. Please help
[TABLE="width: 286"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Time[/TD]
[TD]Hour[/TD]
[TD]Transaction amount[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]09:23:02[/TD]
[TD]9[/TD]
[TD]16.76[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD]15.00[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]09:59:16[/TD]
[TD]9[/TD]
[TD]0.7[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]11:03:14[/TD]
[TD]11[/TD]
[TD]3.25[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD][/TD]
[TD][/TD]
[TD]9.99
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
How about
Code:
Sub CopyDown()

   With Range("B3", Range("C" & Rows.Count).End(xlUp).Offset(, -1))
      .Value = Evaluate(Replace(Replace(Replace("if(@<>"""",@,if(@2<>"""",@1,""""))", "@1", .Offset(-1).Address), "@2", .Offset(, 1).Address), "@", .Address))
   End With
End Sub
 
Upvote 0
Thank you Fluff,
I just managed to get it right now. I selected the column range (B2 all the way down ) then used F5, then selected special and chose blanks, click ok. So all my blanks under that was selected. Then in the first cell Excel automatically enters you into B3 where I then said B3 to = B2, then finally holding in Ctrl and pressing enter. All my blanks now fill up with the top one.
 
Last edited:
Upvote 0
Glad you got it sorted & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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