VBA Code to copy value in a cell and paste in at the first row of the Table and delete rows below after

ipmh35

New Member
Joined
Aug 20, 2021
Messages
4
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
  2. MacOS
Hi, I have to clean different excel sheets with separate tables within each sheet. I have written a vba code to extract rows between two values and paste them onto a new sheet. The issue I have now is that I want to consolidate the rows in the new sheet into a total instead of individual rows.


attachment.php
Screenshot 2021-08-20 at 4.03.41 PM.png


From the above pic, I want the total quantity (which is 9) for the top table to replace the "1" in the first row. Thereafter, I want to delete all rows below the first row of the table till the start of the next company. After that, I want to repeat the process for Company B's table. How do I write the vba code for this? I was thinking of using find to search for "Total" and use offset after that but I'm not sure if that's possible. Thank you
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,214,400
Messages
6,119,284
Members
448,885
Latest member
LokiSonic

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