I got the below code from Mr excel and slightly ameded to my needs. It supposed to act like CNTL+ G and select blank. It is easy to do it in excel if it is one sheet. I would like to make the code dynamic so that I can only it in all sheets.
So, I have two questions: Why is the macto stops at line 18 and does not fill in the rest of the cellls? And How do I incorporate a loop for all sheets and cell which have the same strcture as the attached. The attached sample has all the requirments.
Thanks
Public Sub CopyDown()
Range("A:Z").UnMerge
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = 1 To LR
If Range("A" & i).Value = "" Then
Range("A" & i - 1 & ":B" & i - 1).Copy Destination:=Range("A" & i)
End If
Next i
End Sub
Bookmarks