Excel vba code to add row based on column values and sum values to the newly added row

Ganeshan

New Member
Joined
Dec 15, 2021
Messages
6
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
The following are the conditions that I am trying to achieve
  1. Sort Column F and H, then add a row when there is a value change in both rows. The condition must add a row when the values change
  • Sell - D
  • Sell - S
  • Buy - D
  • Buy - S
  1. After creating the blank row the Column I must sum the values by looping and the summed value must populate in the newly inserted row
  2. Copy the summed value to another worksheet into a particular cell, the code must work with any number of data.
 

Attachments

  • Screen Shot 2021-12-19 at 12.42.36 PM.png
    Screen Shot 2021-12-19 at 12.42.36 PM.png
    166.5 KB · Views: 34

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,214,919
Messages
6,122,260
Members
449,075
Latest member
staticfluids

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