Indentify Empty Text Cells ("")

  • why when a column is copied do blank cells no longer become blank. i have a macro below that writes data to a column based when cells are balnk it skips them. it works great except for when you copy a column the cells are no longer blank. please help - this is bugging me. the code is below.


    Code
    Sub RET_DATA()
            For i = 1 To rs.Range("L65536").End(xlUp).Row
            Lastrow = Range("A65536").End(xlUp).Row
            Cells(Lastrow + 1, 1) = rs.Cells(i, 17)
        Next i
    End Sub
  • Re: blank cells - not really blank


    after reading your reply and thinking about it for a second - i think i may have found the problem. it i have a formula that reads =if(a1="","") the -""- therefore dont make the cell blank. how do you avoid this?

  • Re: blank cells - not really blank


    Hi Zotee,


    Use:
    =if(a1="",)


    with nothing for the case of true and this will set the cell to blank...if it were a full 'if' statement with something there for the FALSE case it would look something like:


    =if(a1="",,<something here for FALSE case>)


    Regards,


    Jon

  • Re: blank cells - not really blank


    Not quite sure if this will help you, but if your cells have a formula that returns a "" then the cells will nto be Empty/Blank because they hav a formula in them (as you already figured out), but the LEN of the cell's will be zero. So use LEN in your VBA code (or cell formulas) to decide what action to take.

Participate now!

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