+ Reply to Thread
Results 1 to 6 of 6

Fill in blank cells if adjacent cell has value, then do for next set of data

  1. #1
    Registered User
    Join Date
    11-11-2013
    Location
    Memphis
    MS-Off Ver
    Excel 2010
    Posts
    3

    Fill in blank cells if adjacent cell has value, then do for next set of data

    Hi guys. I'm trying every conceivable angle I can think of in vba and coming up empty. What I have is a spreadsheet similar to this:

    Column A Column B

    1. 1234567
    2. 2345678
    3. 3456789
    4. 4567890 A0001
    5.
    6. 9876543
    7. 9876543
    8. 9876543
    9. 1234578
    10. 3456789 A0002

    What I would like to do is to fill in B1:B3 with A0001 and B6:B9 with A0002. The number of rows in each set of data will vary, but the identifier (A000X) will always be located in the row in column B adjacent to the last entry for that set of data in column A and there will always be empty cells between data sets. The number of data sets will also vary.

    Any help would be greatly appreciated. Thanks

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,298

    Re: Fill in blank cells if adjacent cell has value, then do for next set of data

    Easy with this:

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    11-11-2013
    Location
    Memphis
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Fill in blank cells if adjacent cell has value, then do for next set of data

    You nailed it, Bernie. Beautiful code, too! Thanks a lot.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Fill in blank cells if adjacent cell has value, then do for next set of data

    Too late, but FWIW.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-11-2013
    Location
    Memphis
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Fill in blank cells if adjacent cell has value, then do for next set of data

    Thanks, John. Yours worked like a charm, too. And in two lines -- cool.

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,298

    Re: Fill in blank cells if adjacent cell has value, then do for next set of data

    Here's a one liner
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Fill blank cells with data directly above that blank cell
    By gibson2503 in forum Excel General
    Replies: 3
    Last Post: 06-05-2013, 10:07 AM
  2. How to color-fill blank cells, then once data is entered cell is no-fill
    By hatemail13 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-28-2013, 07:57 PM
  3. Fill adjacent cells with data
    By NickJW in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-26-2011, 03:48 PM
  4. Auto fill blank cells with data in a cell above
    By StudentMod in forum Excel General
    Replies: 4
    Last Post: 05-09-2008, 04:37 PM
  5. [SOLVED] How would I fill blank cells with the data from a previous cell?
    By Clive Darling in forum Excel General
    Replies: 3
    Last Post: 01-05-2005, 10:06 PM

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