I never use a Do While or Do Until anymore. To much chance for
infinite loops. I use For Next. For example if you know the rows are
5 to 15, in a delete run a backwards For Next. As for the merged
cells, maybe removing xlup will work. Or unmerging them and
remerging them. Anyway heres a for next loop:
Range("A5:C15").Select
Selection.Sort Key1:=Range("A5"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Dim i as integer, Val1 as string
For i = 15 to 5 step -1
Val1 = Range("D"& i).value
if Val1 = 0 then
range("D"& i).EntireColumn.Delete 'shift:=xlUp
end if
next i