Add cell value from cell above when cell is empty

G

Guest

Hi

here is my case:

IF CELL value is empty in the area from cells (3,1) to cells (defined
below,6) then I want excel to add the cell value from cell above. This should
continue to and excluding when cells (x,7) has the value "==============="

Is it possible to solve?

Sverre
 
G

Guest

Sub FillCells()
Dim rng as Range, ar as Range, cell as Range
Set rng = columns(1).SpecialCells(xlBlanks)
for each ar in rng
for each cell in ar
if cell.row >= 3 then
if cell.offset(0,6) <> "===============" then
cell.Resize(1,6).Filldown
end if
end if
next
Next
end Sub

Obviously, test this on a copy of your data.
 

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