msquared99
Member
Here is the situation, I have a macro that writes an IF formula to the last row then does a copy/paste value. There will be an actual value in say cell P3, then several blanks and an actual value in cell P10 and so on. The number of blank cells between the cells with an actual value varies. The formula is =IF(P3="","",P3)
As we know with this type of formula when you copy/paste value then select cell P3 then use SHIFT+CTRL+Arrow Down, it will highlight all of the cells that once had a formula. COUNTBLANK indicates there are X number of blank cells.
I have a section of VBA code that uses Intersect. It errors out saying "No cells were found".
How do I get the cells inbetween that are supposed to be blank to actually be blank.
Below is the code used and I hope it is entered into the forum correctly.
As we know with this type of formula when you copy/paste value then select cell P3 then use SHIFT+CTRL+Arrow Down, it will highlight all of the cells that once had a formula. COUNTBLANK indicates there are X number of blank cells.
I have a section of VBA code that uses Intersect. It errors out saying "No cells were found".
How do I get the cells inbetween that are supposed to be blank to actually be blank.
Below is the code used and I hope it is entered into the forum correctly.
Code:
With Intersect(Range("P3").CurrentRegion, Range("P:P"))
.SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=R[-1]C16"
.Value = .Value
End With