Consulting

Results 1 to 3 of 3

Thread: Skip to next empty cell

  1. #1

    Skip to next empty cell

    I've received good feedback on my questions here so I'll ask another.

    I'm trying to find/write some vba code that will select the NEXT empty cell BELOW the active cell with there being empty cells above the active cell and the active cell also possibly being empty.

    I'm a novice so the simpler the code the better. Thanks for any help.

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    [VBA]Sub NexgtBlank()
    Dim c As Range
    Set c = ActiveCell
    If c(2) = "" Then
    c(2).Select
    ElseIf c(3) = "" Then
    c(3).Select
    Else
    c(2).End(xlDown)(2).Select
    End If
    End Sub
    [/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    Thanks. Works perfectly.

Posting Permissions

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