Apply a formula to only visible cells in column O

Knockoutpie

Board Regular
Joined
Sep 10, 2018
Messages
116
Office Version
  1. 365
Platform
  1. Windows
Hi everyone,

can someone help me come up with something to apply a formula to the first visible cell under the header in Column O, and then apply that formula down to the end of data for visible cells only?

With ActiveSheet.Range("O2:O" & Cells(Rows.Count, 2).End(xlUp).Row).SpecialCells(xlCellTypeVisible)
.Cells.FormulaR1C1 = ActiveCell.Formula2R1C1 = "formulahere"
End With

currently I am using this which has always worked for me in the past ^, however with my formula which is pulling data from a sharepoint directory, the result return FALSE using this method.

Appying the formula without this returns correct results.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try this:

VBA Code:
  With ActiveSheet.Range("O2:O" & Cells(Rows.Count, 2).End(xlUp).Row).SpecialCells(xlCellTypeVisible)
    .Formula = "formulahere"
  End With

It would also be helpful if you put the formula you have in the cell to test it in the macro.

But try it, if you have questions, don't hesitate to ask me.

Dante Amor
 
Upvote 1
Solution
Try this:

VBA Code:
  With ActiveSheet.Range("O2:O" & Cells(Rows.Count, 2).End(xlUp).Row).SpecialCells(xlCellTypeVisible)
    .Formula = "formulahere"
  End With

It would also be helpful if you put the formula you have in the cell to test it in the macro.

But try it, if you have questions, don't hesitate to ask me.

Dante Amor
That worked!
 
Upvote 0

Forum statistics

Threads
1,215,073
Messages
6,122,976
Members
449,095
Latest member
Mr Hughes

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