Formula in VBA not working

taostep1

Board Regular
Joined
May 18, 2016
Messages
65
Hi All,

The following VBA is kicking out a 1004 error and can't seem to understand why this is happening.

Sub test()


Sheets("pivot").Select


Range("F5").Select
ActiveCell.FormulaR1C1 = "=IF(COUNTIF('Confirmed Movement '!$L:$L,RC[-2])>0,""INPUT IS NEEDED"",""NOT ON EDGE ROSTER"")"




End Sub

Any help would be great.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Takae

Well-known Member
Joined
Jul 1, 2015
Messages
791
Platform
  1. Windows
Please try it.
Range("F5").FormulaR1C1"=IF(COUNTIF('Confirmed Movement '!C12,RC[-2])>0,""INPUT IS NEEDED"",""NOT ON EDGE ROSTER"")"
 

taostep1

Board Regular
Joined
May 18, 2016
Messages
65
But I need the entire range of column L for this formula to legit work. Is there another alternative?
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,351
Office Version
  1. 365
Platform
  1. Windows
C12 is the entire column L, in R1C1 notation.
 

Forum statistics

Threads
1,170,954
Messages
5,872,944
Members
432,952
Latest member
Il Prete

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
Top