Finding 1st empty cell in range

  • I am running the following code and for some reason it is finding the 1st empty cell in a completely different range. For example, it goes to the 1st empty cell in the "AA19:AA24" range. I just ran it and it went to cell "AA20" because AA19 already had a value in it and every cell in the "AA11:AA17" range was empty. I'm sure it is something simple that I am missing but I just can't figure it out. Any ideas?

  • Adding to what jolivanes has indicated:


    "*" will find first non blank cell

    "" will find first blank cell


    But range.Find is a circular function that begins looking after the first cell in the stated range and circles back around to first cell, it being the last cell checked.

    So if the first cell in the range may be the first blank, but not the only blank, you'll need to specify the after cell.

    try

    Code
    Set u6 = wksht1.Range("AA11:AA19").Find(What:="", After:=wksht1.Range("AA19"), SearchOrder:=xlRows, SearchDirection:=xlNext, LookIn:=xlValues)

Participate now!

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