+ Reply to Thread
Results 1 to 6 of 6

Filling blank cells based on neighbouring column

  1. #1
    Registered User
    Join Date
    03-03-2009
    Location
    Budapest
    MS-Off Ver
    Excel 2007
    Posts
    44

    Filling blank cells based on neighbouring column

    Dear All,

    I have a sheet that contains 2 colunms, A and B; they look like below:

    A: B:
    X 1
    Y (empty)
    Z (empty)

    The last two cells in column B are empty, but this is subjected to change
    I would like to paste the value of a cell (eg D3) to fill in the empty cells in column B with VBA (the last n cells are empty, there are no other empty cells)

    Could you please help?
    Many thanks

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Filling blank cells based on neighbouring column

    Assuming they are as you say truly empty (and given the nature of the used range)

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-03-2009
    Location
    Budapest
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Filling blank cells based on neighbouring column

    Hi!

    This works, but the problem is that it fills in almost 40 cells in column E while I would need it to fill only 2 cells
    I am attaching the file, so you can see what I am talking about
    (the value in L1 should be pasted into the yellow cells, and it also may happen that there are more cells to be filled in ,depending on the number of lines already present in columns A:D)

    Many thanks in advance
    Attached Files Attached Files

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Filling blank cells based on neighbouring column

    I had a quick look at your code... if you're looking to copy the filtered range only perhaps:

    Please Login or Register  to view this content.
    Last edited by DonkeyOte; 11-02-2009 at 06:02 AM.

  5. #5
    Registered User
    Join Date
    03-03-2009
    Location
    Budapest
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Filling blank cells based on neighbouring column

    This looks great!!! Thank you!!
    The only problem is that because of offset with the autofilter it pastes 1 row less, but if I delete offset it pastes the header row as well....any tips?

    Many thanks again!

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Filling blank cells based on neighbouring column

    Whoops... misplaced Offset, change

    Please Login or Register  to view this content.
    to

    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)

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