VBA Application-Defined or Object Defined Error

Mattandy55

New Member
Joined
May 27, 2016
Messages
20
Hello,

I have the following code:
Sheets("Report").Select
Range("M1").FormulaR1C1 = "=COUNTA(C[-10])+3"
Range("M5:M" & Range("M1").Value).FormulaR1C1 = "=IF(COUNTIF([@Type],""*Bonus*""),""Yes"",""No"")"
Range("N5:N" & Range("M1").Value).FormulaR1C1 = "=IF(COUNTIF([@Type],""*Catch*""),""Yes"",""No"")"
Range("O5:O" & Range("M1").Value).FormulaR1C1 = "=IF(OR([@Column1]=""yes"",[@Column2]=""yes""),""Yes"",""No"")"

It runs the first 2 lines fine and then once it gets to the Range("N5:N") line it throws the Application-Defined or Object Defined Error. Any idea how to clean up this code or how to get around this error?

Thanks
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Please post a sample of your data so we can see what your data looks like.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,027
Members
452,374
Latest member
keccles

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