View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Creating a macro where values are copied and pasted into a sheet

Why not just a sumproduct formula to get your sum?
=sumproduct((sheet1!a2:a22="joe")*(sheet1!b2:b22=1 )*sheet1!d2:d22)
or
=sumproduct((sheet1!a2:a22=a1)*(sheet1!b2:b22=1)*s heet1!d2:d22)

--
Don Guillett
SalesAid Software

"BrianMo" wrote in message
...
I am trying to create a macro that when run will take information from one
sheet and copy it into another. On the first sheet called Multi basis
report
there are 4 columns. (B) Security Id, (C) Security, (D) Realized G/L, and
(E)
Total Gain/Loss. I need to take the security Id #, the security name, and
it's realized gain/loss and paste it onto a sheet named 2006 Sched D
changes
for transfers. The issue I am having is that on my first sheet there are
multiple lines for each security Id instead of just one consolidated line.
I
have created subtotals for each security so there is a single line with
the
security Id and the total column summed up. Any help that can be offered
is
greatly appreciated.

Thanks in advance,
Brian Monaghan