View Single Post
 
Old 12-08-2011, 11:12 AM
Manit Manit is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Dec 2011
Posts: 2
Manit is on a distinguished road
Default Application-defined or Object-defined error

Hi:

I guess it is vary basic error but as I am new to the field, I am having hard time solving the error. Here is the what I am trying to do:

I have three columns in excel sheet. One column has number and another two columns have text. I am trying to sum numbers from the number column based on matched string in text columns. I do this very often. SO created macro for this. But, it is giving me run time error:Application-defined or Object-defined error.

Here is the code:

Range("R8").Select
ActiveSheet.Paste
Range("R8").Select
ActiveCell.FormulaR1C1 = "=IF(SUMIF($Q$8:$Q$469,Q8,$P$8:$P$469) = 0, """", SUMIF($Q$8:$Q$469,Q8,$P$8:$P$469) )"
Range("R8").Select
ActiveSheet.Copy
Range("R9").Select
ActiveSheet.Paste
Range("R9").Select
Selection.AutoFill Destination:=Range("R9:R469")
Range("R9:R469").Select

Greatly appreciate any help!!!!
Reply With Quote