Clean way to sum two cells from another workbook

Blunder1

Active Member
Joined
Jun 2, 2010
Messages
250
Hi,

I have two works books, a master and a summary. In some of the cells in the summary sheet i need to value to be the sum of two cells in the master book. I'm using the below in my code but would like to modify it so that 5 to the right of the activecell is the sum of cells c14:15 in the master.

Below is the code i currectly use when i dont have to sum

Code:
ActiveCell.Offset(0, 4).Value = wb.Sheets("Summary").Range("f30").Value

Thanks in advance

Blunder
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Try

Code:
ActiveCell.Offset(0, 4).Value = WorksheetFunction.Sum(wb.Sheets("Master").Range("C14:C15"))
 
Upvote 0
Then you would need to 'spell it out'

Code:
ActiveCell.Offset(0, 4).Value = wb.Sheets("Master").Range("C14").Value - wb.Sheets("Master").Range("C15").Value
 
Upvote 0
Try

Code:
ActiveCell.Offset(0, 4).Value = wb.Sheets("Master").Range("C14").Value + wb.Sheets("Master").Range("E14").Value - wb.Sheets("Master").Range("J14").Value
 
Upvote 0

Forum statistics

Threads
1,224,612
Messages
6,179,890
Members
452,948
Latest member
Dupuhini

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