I want to fill a column based on another columns [closed]

I want a VBA function that fills column c based on the following criteria. Note: I cannot use a formula because column c already has values.

IF B is blank then C equals -D

I want this to work for a range of a 1000 rows

Thanks in advance!

1

1 Answer

Try this. Adjust to your needs.

Sub fill() For x = 1 To 1000 If Range("B" & x).Value = "" Then Range("C" & x).Value = Range("D" & x).Value * -1 Next x End Sub 
2

You Might Also Like