Can you pass an array from one workbook to another?

soldierchuck

New Member
Joined
Mar 14, 2013
Messages
4
I am working on a project where employees enter numbers into a sheet and the sheet adds those numbers to a monthly total. i.e. John makes 5 widgets on the first and 5 on the second and 10 on the third. John's sheet would show

first second third fourth fifth monthly
5 5 10 20

What I am trying to do is get the numbers to add to numbers already in a master sheet in a different workbook. I can open the workbook and copy and paste the numbers but it would really make things much simplier to be able to add the new numbers to the old numbers in the master workbook - i.e. a column that adds the widgets of all employees for the month. I have it set to update numbers in the master every time they save or close or add new numbers to their own sheets.

I have tried to pass an array and add the elements of the array to the elements in the master workbook but it always zeros out all the values in the array. Is there a way to pass the values of an array to a different workbook? The only thing I can get to work is a direct copy/paste and that just overwrites the values. Sorry for the lack of code but I really don't have any because after not being able to pass the array values and not being able to find answers online or from others in the department I kind of resigned myself to copy/paste, but that is causing other problems when we roll over to a new month. I just need to know if it's possible and to be pointed in the right direction, I know it's probably something simple I've overlooked or maybe there is a better way that I'm not thinking of.

Any help would be appreciated.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Ok after messing with this and giving up and then messing some more and giving up (well maybe taking a break not giving up) I have found a way to add the numbers without using arrays, I'm posting the line so maybe it can help someone else.

Range("B" & i).PasteSpecial Paste:=xlPasteValues, Operation:=xlAdd, SkipBlanks:=False, Transpose:=False
 
Upvote 0

Forum statistics

Threads
1,214,611
Messages
6,120,509
Members
448,967
Latest member
screechyboy79

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