Results 1 to 7 of 7

Macro to find the first empty cell in a column

This is a discussion on Macro to find the first empty cell in a column within the Excel Questions forums, part of the Question Forums category; Hi ! I'm looking for a macro which will find the first empty cell in a column please ! Thanks ...

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    22

    Default

    Hi !

    I'm looking for a macro which will find the first empty cell in a column please !

    Thanks a lot !

  2. #2
    New Member
    Join Date
    Nov 2002
    Posts
    7

    Default

    This should do it:

    ActiveCell.Offset(1, 0).Select
    Do While Not IsEmpty(ActiveCell)
    ActiveCell.Offset(1, 0).Select
    Loop

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Guderup, Denmark
    Posts
    287

    Default

    You could also try
    Range("A1").End(xldown).Offset(1,0).Select

    wich should be a lot quicker

    regards Tommy

  4. #4
    New Member
    Join Date
    Apr 2002
    Posts
    22

    Default

    Thanks a lot guys !

    It's very nice !

  5. #5

    Join Date
    Oct 2002
    Posts
    49

    Default

    I think the following covers all possible situations (the other two suggested solutions may not) :-

    If Application.WorksheetFunction.CountA("A:A") = 0 Then
    [A1].Select
    Else
    On Error Resume Next
    Columns(1).SpecialCells(xlCellTypeBlanks)(1, 1).Select
    If Err <> 0 Then
    On Error GoTo 0
    [A65536].End(xlUp)(2, 1).Select
    End If
    On Error GoTo 0
    End If

  6. #6
    New Member
    Join Date
    Jul 2007
    Posts
    12

    Default Re: Macro to find the first empty cell in a column

    Do we need to add a Form button and also add a Module to copy the coding? TQ

  7. #7
    New Member
    Join Date
    Nov 2010
    Posts
    10

    Default Re: Macro to find the first empty cell in a column

    Quote Originally Posted by Pear View Post
    I think the following covers all possible situations (the other two suggested solutions may not) :-

    If Application.WorksheetFunction.CountA("A:A") = 0 Then
    [A1].Select
    Else
    On Error Resume Next
    Columns(1).SpecialCells(xlCellTypeBlanks)(1, 1).Select
    If Err <> 0 Then
    On Error GoTo 0
    [A65536].End(xlUp)(2, 1).Select
    End If
    On Error GoTo 0
    End If

    Dear Pear,

    You solution is wonderful, however can you please help me with the logic in it as i am new for excel macro .

    what i wish to do with this is:-

    Can we change the first logic to particular cell of the colums in my case I am willing to find the 9th cell and if it is not blank than move to next cell i.e. 10th.

    Thanking you in advance.

    Email Id: tech[dot]problemsolved[at]gmail[dot]com

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com