|Don't think you need a Macro, try this formula in cell I1|
Drag down as many rows as needed.
One caveat about H1=0 and G1="",
Excel considers a SPACE a valid character,
so even if it looks blank it may not be.
There may be a Space character inhabiting the cell.
Also, what happens if H1 = 1 and G1 = "" <blank>
or can this never occur?
message edited by mmcconaghy