macro run time error

Frank3923

Board Regular
Joined
Jan 20, 2003
Messages
244
I am receiving a run-time error '1004': on the macro code shown below.
I was adapting some code that I received help here on the board. If someone could point out to me the error I am making on the formula line, I would appreciate it.

Application-defined or object-defined error
-the following line high lights to yellow-
....Range("M" & a).FormulaR1C1 = "=IF(RC9=>1,""YES"",""NO"")"

What I need the code to reflect is IF (Column I cell is greater than 1, ""YES"", ""NO"")

Starting row, would be 7, step to be 2, and the last row to be determined by Column "G", just to clarify the the numbers in column "I", are every 2 rows.

Sub fill_Down_BP_xYN()

Dim LR As Long, a As Long
Application.ScreenUpdating = True
With Worksheets("BP-Proj-Runs")
LR = .Cells(Rows.Count, "G").End(xlUp).Row
For a = 7 To LR Step 2

.Range("M" & a).FormulaR1C1 = "=IF(RC9=>1,""YES"",""NO"")"

Next a
End With
Application.screenUpdating = false
End Sub

Thank you in advance
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
I think that should be

Code:
.Range("M" & a).FormulaR1C1 = "=IF(RC[-4]=>1,""YES"",""NO"")"
 
Upvote 0
Vog - thank you for the rapid response. I inserted your revised code, and still receive the same error message. I would appreciate any additional ideas

Thanks
 
Upvote 0
Try this

Code:
Sub fill_Down_BP_xYN()
Dim LR As Long, a As Long
Application.ScreenUpdating = False
Worksheets("BP-Proj-Runs").Select
    LR = Cells(Rows.Count, "G").End(xlUp).Row
    For a = 7 To LR Step 2
        Range("M" & a).Formula = "=IF(I" & a & ">=1,""YES"",""NO"")"
    Next a
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,866
Members
452,948
Latest member
UsmanAli786

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