simora
06-03-2020, 02:35 PM
On a Worksheet, I have a formula in cell C4
I want to copy down that formula, but only in the cells where the color is White, and Column E on that same row contains a Formula
The formula in C4 is =K4
How can I change VBA so that only those cells that meet that criteria gets the formula
This code puts the formulas on all the cells, which is NOT what I'm trying to do.
For Each cell In ActiveSheet.Range("C4:C120")
If cell.Interior.Color = vbWhite And cell.Offset(0, 2).HasFormula Then
cell.Formula = "=K4"
cell.AutoFill Destination:=Range("C4:C120")
End If
Next
I want to copy down that formula, but only in the cells where the color is White, and Column E on that same row contains a Formula
The formula in C4 is =K4
How can I change VBA so that only those cells that meet that criteria gets the formula
This code puts the formulas on all the cells, which is NOT what I'm trying to do.
For Each cell In ActiveSheet.Range("C4:C120")
If cell.Interior.Color = vbWhite And cell.Offset(0, 2).HasFormula Then
cell.Formula = "=K4"
cell.AutoFill Destination:=Range("C4:C120")
End If
Next