Delete specific blank range of column only

  • Dear Team,

    If column B&C value is blank then i want to delete the specific row cells from A to H only.

    1. Dim rngBlanks As Range
    2. Dim i As Integer
    3. For i = 2 To 3
    4. On Error Resume Next
    5. Set rngBlanks = Columns(i).SpecialCells(xlCellTypeBlanks)
    6. On Error GoTo 0
    7. If Not rngBlanks Is Nothing Then
    8. rngBlanks.EntireRow.Delete
    9. End If
    10. Next

    In above code instead of Entire row, how can i mention column A to H

    Kindly advice me for the above problem

  • Dear Dave,

    I tried your code.

    But In between A : H there is merged cells. So is am getting error message.

    I am attaching my file here for your reference. Kindly clear the problem.

    If it is not possible on merged cells kindly modify some other way.

  • Ya, you never mentioned merged cells in the original question.

    This is not the first time it has been mentioned that merged cells suck, and should not be used if you want to manipulate data.

    I know it makes the layout more convenient, but working with them is a pain.

    That being said

    Input the data into the schedule sheet first, then count the cells in the range to determine the number of cells to merge.