View Single Post
 
Old 12-08-2011, 07:35 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

FWIW, it seems to me the code could be reduced to:
Code:
With Range("R8")
  .Paste
  .Formula = "=IF(SUMIF($Q$8:$Q$469,Q8,$P$8:$P$469)=0,"""",SUMIF($Q$8:$Q$469,Q8,$P$8:$P$469))"
  .AutoFill Destination:=Range("R8:R469")
End With
Range("R9:R469").Select
As you'll see, you don't need to select cells to work with them. I left the final selection in place, though, as I don't know what you want to do next.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote