vba merge for each loop

  • Hi All

    Please help

    Am currently having an issue with this piece of code.

    Have used debugger to see why it is using so much memory and shows that it is adding columns and not moving on.

    Here is the code :

    For lrow = 14(data starts at 13) to LastRow

    For lcol = 1 to LastCol

    (Have a function to change lcol to cell Ref, ie 1 to a etc, this is then represented by a variable col)

    Set MyRange = Range("A" & lrow, col & LastRow)

    For Each cell in MyRange

    If cell.value = "" Then

    Range(cell, cell.Offset(-1,0)).Merge

    End If


    Next lcol

    Next lrow

    Got a feeling it is for each cell but when changing this am unable to use cell as a reference

    Please help

    Thank you & first post so please point me in the right direction if any of this is wrong

    all feedback(good or bad) is appreciated

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!