Converting listed data to pivot table format - repeatedly copying and pasting between two specified instances

financial_analyst22

New Member
Joined
May 21, 2019
Messages
1
Hi Everyone,

I am no VBA expert and appreciate any help you can provide. I would like to learn how to search for a before and after instance to copy and paste information in between those two instances. And then repeat the process. This helps to create a format usable for a pivot table.

For example if my report looks like: 1) the account information (and beginning balance) in its own row, 2) all the transactions for that account in the rows below, followed by 3) an ending balance, and then it repeats with a new account followed by those transactions and an ending balance, and so on
Row #Column AColumn BColumn CColumn D
1Account Information 1"Beginning Balance"
2Date of TransactionTransaction Info.Transaction Info.
3Date of TransactionTransaction Info.Transaction Info.
4Ending Balance thru...
5Account Information 2"Beginning Balance"
6Date of TransactionTransaction Info.Transaction Info.
7Ending Balance thru...
8Account Information 3"Beginning Balance"
9Account Information 4"Beginning Balance"
10Date of TransactionTransaction Info.Transaction Info.
11Ending Balance thru...

<tbody>
</tbody>

I would like to:
1) Search for "Beginning Balance" in column D. There is a beginning balance instance in column D for every new account.
2) Then I would like to copy a TRIMMED version (there are extra spaces that I don't want) of the column B account information into column A next to every Transaction until I reach the ending balance row.
3) I would like this to repeat for every account section.
4) Final step: delete the account information/beginning balance rows & the ending balance rows

Note: There are some instances where there is a row for an account and beginning balance but no transactions and no ending balance row so those will need to be skipped over. (Example in row 8 for Account Information 3)

Goal Table:
Row #Column AColumn BColumn CColumn D
1Account Information 1Date of TransactionTransaction Info.Transaction Info.
2Account Information 1Date of TransactionTransaction Info.Transaction Info.
3Account Information 2Date of TransactionTransaction Info.Transaction Info.
4Account Information 4Date of TransactionTransaction Info.Transaction Info.

<tbody>
</tbody>

Thank you in advance for your help!
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Forum statistics

Threads
1,214,834
Messages
6,121,873
Members
449,056
Latest member
ruhulaminappu

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