Vba code for a sumif formula - place a new sheet

OilEconomist

Active Member
Joined
Dec 26, 2016
Messages
421
Office Version
  1. 2019
Platform
  1. Windows
Thanks in advance for your assistance, and I will let you know if this works.

Objective: To Sumif Column J based on Column A from Sheet 1 into Sheet 2, where not only are Columns J and A transferred, but the remaining columns are also.

Given:

-Sheet1:
--N rows x 10 Columns (Columns A through J)
--The number of rows will vary hence the N rows.
--The leading column (Column A/first column) contains a series of numbers stored as text values that need to remain text values.
--Column A is the basis of the sumif so it needs to be copied and pasted as column J has the values to be summed.

Sheet2:
-Empty Sheet with the exception of the heading being created/correct already.
--Destination for the SUMIF Formula
--It will need to contain all of the remaining columns which
--Column A – Column A from Sheet1 where the repeated numbers stored as texts need to be deleted so the SUMIF can be performed.
--The rest of the columns (Columns A through I) are identical with respect to column A, so column A in Sheet 2 can just look up the rest of the columns from Sheet 1.
--Column J =SUMIF(Sheet1!A:A,$A3,Sheet1!J:J)
--Finally sort Column J from greatest to smallest
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,215,046
Messages
6,122,854
Members
449,096
Latest member
Erald

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