+ Reply to Thread
Results 1 to 5 of 5

Skipping Through Empty Cells to find Data

  1. #1
    Registered User
    Join Date
    01-29-2010
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2007
    Posts
    47

    Skipping Through Empty Cells to find Data

    I'm just learning VBA, and trying to figure things out as best I can. I have a text book to work from but a lot of the very basics are skipped over while emphasis is on the logic based functions.

    What I am trying to do is start in a certain cell and move to the right one column at a time until I find a cell that has data (numerical) in it. I think I have the logic correct but the syntax wrong.

    This is what it basically looks like:

    Please Login or Register  to view this content.
    The worksheet with data is called "Elevations" and the row_count and col_count are defined as integers and given start points. I'm not sure the "IsEmpty" function is what I want, or if how I am referencing the worksheet and cell is right.

    Following this I need to do calculations based on the values in worksheet "Elevations" and report them to the same cell in worksheet "Settlement".

    Any help is greatly appreciated.
    Last edited by ih8xc; 06-10-2010 at 07:24 PM.

  2. #2
    Forum Contributor
    Join Date
    12-03-2009
    Location
    Providence RI
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    260

    Re: Skipping Through Empty Cells to find Data

    Well the simple way without moving cell by cell (never a good idea) is:

    Please Login or Register  to view this content.
    Or if you want to loop as you were trying to:

    Please Login or Register  to view this content.
    Last edited by Dulanic; 06-10-2010 at 06:44 PM.

  3. #3
    Registered User
    Join Date
    01-29-2010
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Skipping Through Empty Cells to find Data

    I don't want to use ActiveCell because this whole workbook will be a template sheet for multiple projects and people, most of whom wont have any idea what they are doing (including me apparently). I want the macro to find the data itself without needing the user to select a start point.

  4. #4
    Forum Contributor
    Join Date
    12-03-2009
    Location
    Providence RI
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    260

    Re: Skipping Through Empty Cells to find Data

    So replace ActiveCell with a specific cell.

    Please Login or Register  to view this content.
    For example.

    Another way using your method of changing the column value is:

    Please Login or Register  to view this content.
    Last edited by Dulanic; 06-10-2010 at 07:03 PM.

  5. #5
    Registered User
    Join Date
    01-29-2010
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Skipping Through Empty Cells to find Data

    Thank you very much. I've got it working, albeit I'm getting zeros in cells that I want to appear blank, but that shouldn't be too hard to figure out.

+ 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