Thread: Paste
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Paste

I think this should do it

val = Evaluate("=SUMPRODUCT((AGTHistory!A1:A11000=A" & 17 + j & _
")*(AGTHistory!C1:C11000=Main!B5),AGTHistory!K1:K1 1000)")
Worksheets("main").Range("B18:C19").Value = val

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"ram" wrote in message
...
Can someone show me how the results from the following code can be pasted

all
at the same time instead of pasting in one cell at a time.


Dim J As Integer

For J = 1 To 2

Worksheets("main").Range("B" & 17 + J).Value =
Evaluate("=SUMPRODUCT((AGTHistory!A1:A11000=A" & 17 + J &
")*(AGTHistory!C1:C11000=Main!B5),AGTHistory!K1:K1 1000)")
Worksheets("main").Range("C" & 17 + J).Value =
Evaluate("=SUMPRODUCT((AGTHistory!A1:A11000=A" & 17 + J &
")*(AGTHistory!C1:C11000=Main!B5),AGTHistory!L1:L1 1000)")
Next J


End Sub

Thanks for all your help