From: Rick Rothstein on 18 Feb 2010 13:30 Try this code (return the row instead of the address if that is what you want)... On Error Resume Next BlankCellAddress = Selection.SpecialCells(xlCellTypeBlanks)(1).Address On Error GoTo 0 -- Rick (MVP - Excel) "plugger" <plugger(a)discussions.microsoft.com> wrote in message news:0D95A3DC-CB7D-4C09-AEA2-D9499152748A(a)microsoft.com... > how to find first empty cell in a selected column ie A12:A20 with a macro
From: Rick Rothstein on 18 Feb 2010 13:35 I should have mentioned that the empty string would be returned by my posted code if there were no blanks in the selected range. If you change the variable to BlankCellRow (and Dim it as Long) and return the Row property to the variable, then BlankCellRow would be set to zero if there were no blanks in the selected range. -- Rick (MVP - Excel) "Rick Rothstein" <rick.newsNO.SPAM(a)NO.SPAMverizon.net> wrote in message news:%23ac0dhMsKHA.1352(a)TK2MSFTNGP06.phx.gbl... > Try this code (return the row instead of the address if that is what you > want)... > > On Error Resume Next > BlankCellAddress = Selection.SpecialCells(xlCellTypeBlanks)(1).Address > On Error GoTo 0 > > -- > Rick (MVP - Excel) > > > "plugger" <plugger(a)discussions.microsoft.com> wrote in message > news:0D95A3DC-CB7D-4C09-AEA2-D9499152748A(a)microsoft.com... >> how to find first empty cell in a selected column ie A12:A20 with a macro >
First
|
Prev
|
Pages: 1 2 Prev: Cell content capture and release Next: Fire Code after Preceding Events Run |