+ Reply to Thread
Results 1 to 6 of 6

look for blank cell Above starting cell instead of below

  1. #1
    Registered User
    Join Date
    12-15-2010
    Location
    coventry, uk
    MS-Off Ver
    Excel 2003
    Posts
    10

    look for blank cell Above starting cell instead of below

    Hi there, I have a macro that determines the starting cell in a column, and if that cell is not blank, it will find the first blank cell below it. I want it to also find the first blank cell above it._Here is what I have so far:
    Please Login or Register  to view this content.
    I then have similar coding underneath but instead of xlDown, using xlUp, but rather than finding the first blank cell above the start point, it goes straight to the top of the column.
    Is there either a quick fix, or a totally different way of doing it, eg a loop of, is cell blank yes/no, if no look at cell above and try again. if no blanks cells above then return "none found"
    Much appreciated
    Last edited by stuartglass; 01-03-2011 at 10:36 AM.

  2. #2
    Registered User
    Join Date
    12-15-2010
    Location
    coventry, uk
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: look for blank cell Above starting cell instead of below

    still no reply, ive have now dusted off my vba book and come up with this alternative, but this literally does nothing, but has no bugs.

    Please Login or Register  to view this content.
    please help

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: look for blank cell Above starting cell instead of below

    Would you explain what the value in D6 might be, and what you would expect to find?
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    12-15-2010
    Location
    coventry, uk
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: look for blank cell Above starting cell instead of below

    the value in D6 is B15, but it changes based on where the starting value is supposed to be.
    basically its a diary booking system. the Value in D6 matches the time slot in the diary that you want to try and book too. If that time is not available, ie if that cell in the diary is not blank, then it looks before and after to find the nearest available time.

  5. #5
    Registered User
    Join Date
    12-15-2010
    Location
    coventry, uk
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: look for blank cell Above starting cell instead of below

    Eventually working it out myself, after about the 4th total rewrite. In case anyone is interested here it is.

    Please Login or Register  to view this content.
    Now that I've sorted that out, I now need to work out how to make it find the NEXT slot, if the one it thows up as the first available is not suitable for the customer and they were prefer a later/earlier etc time. So I may be back soon.

  6. #6
    Registered User
    Join Date
    12-15-2010
    Location
    coventry, uk
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: look for blank cell Above starting cell instead of below

    dang its not working. The "Do Until" Loops are not doing what they should. They are not looping until the first blank cell, they are only looping once. I know this because when the starting cell is not blank and the one after it is not blank either, it is telling me that time, the one after the start, rather than continuing to look.

    please help.

+ 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