pasting formula on filter cell VBA

jarri

New Member
Joined
May 7, 2021
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
I having problems coping a formula to a filter data in Excel (using VBA). I know is because my formula is set on specific cells and when I run the macro it give and Error 1004.

Range(activecells, Range("S1").end(exldown)).Specialcells(Xcellstypevisible).select
Selection.cells. FormulaR1C1 ="IF R[-257]c[-11]="""",(if(R[-257]c[-10]>50,1000....

not sure what to do

Thank you
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi jarri,

maybe try this (although the use of ActiveCell with a given address might lead to unwanted results)

Code:
On Error Resume Next      'in case of error continue
With Range(ActiveCell, Range("S1").End(xlDown)).SpecialCells(xlCellTypeVisible)
  .FormulaR1C1 = "IF R[-257]c[-11]="""",(if(R[-257]c[-10]>50,1000...."
End With
On Error GoTo 0           'go back to normal error handling
Ciao,
Holger
 
Upvote 0

Forum statistics

Threads
1,214,954
Messages
6,122,462
Members
449,085
Latest member
ExcelError

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