+ Reply to Thread
Results 1 to 5 of 5

Go to empty cell

  1. #1
    Forum Contributor
    Join Date
    12-04-2006
    Posts
    201

    Go to empty cell

    Hi,

    does anyone know how to ensure that the first empty cell within column A is selected before the file is closed.

    thanks

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454
    Hi,

    This in the workbook section of your VBA project

    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Here are a few diffent ways to find a vacant cell, row, column

    Please Login or Register  to view this content.
    To use in code

    Please Login or Register  to view this content.
    sweep

    You are better off declaring your variable as Long which is more efficient than declarring it as varient

    for more info read this page
    http://www.cpearson.com/excel/variables.htm
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454
    Thanks Mudraker,

    That's a bit of a mental block for me. I always go for integer for a loop variable, and when that returns an error, I change it to Variant.

    Must remember long....must remember long...

  5. #5
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    When dealing with an unknown number of rows in Excel I recommend always use Long never Integer

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1