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
ABC
1TimeHourTransaction amount
209:23:02916.76
315.00
4
509:59:1690.7
6
711:03:14113.25
89.99

<tbody>
</tbody>

<tbody>
</tbody>
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
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,215,438
Messages
6,124,873
Members
449,192
Latest member
MoonDancer

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