Populating column N where is is blank or null

S

Steve

I would like to write a macro that writes a formula in
Column N if:
i)Column A and Column H are not null/blank
ii)Column N is currently blank/null
It is important that the macro does not overwrite
values/formulas that are already in other rows of column H.

The formula should be column G minus column C

Thank you very much in advance.

Steve
 
F

Frank Kabel

Hi
try the following macro:
Sub process_rows()
Dim lastrow As Long
Dim row_index As Long
Application.ScreenUpdating = False
lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
For row_index = 1 to lastrow
If Cells(row_index, 1).Value <>"" and _
Cells(row_index, 8).Value <>"" and _
cells(row_index,14).value="" then
cells(row_index,14).formulaR1C1="=R[0]C7-R[0]C3"
End If
Next
Application.ScreenUpdating = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top