+ Reply to Thread
Results 1 to 5 of 5

look for empty/blank cells and copy data from another cell where the first cell....

  1. #1
    Registered User
    Join Date
    01-25-2011
    Location
    Northampton
    MS-Off Ver
    Excel 2010
    Posts
    1

    look for empty/blank cells and copy data from another cell where the first cell....

    hi,

    I am having problems with a spreadsheet i use..

    I need to be able to run a macro (dont think formula would suffice) that looks at the values in column G for blank cells.
    For each blank cell i need to be able to copy the data from a cell in the same column but on a different row where the value of the cell in column A (on the row of the blank cell) is the same as the cell on the row of the cell in column G i want to copy from.

    for example:

    1 | hello | 010
    1 | hello |
    2 | hello | 020
    4 | hello | 040
    2 | hello | 020
    3 | hello |
    3 | hello | 030
    4 | hello |
    3 | hello | 030

    the first blank will need to display '010'.
    the second blank will need to display '030'
    the final blank will need to display '040'

    i hope this makes sense. any help is greatly appreciated.

    thank you!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: look for empty/blank cells and copy data from another cell where the first cell..

    You could do this with a formula in a "free" helper column.

    Assuming the data starts in row 2, in a cell in row 2 put:

    =IF($C2<>"",$C2,IF(VLOOKUP($A2,$A$2:$C$10,3,FALSE)<>"",VLOOKUP($A2,$A$2:$C$10,3,FALSE),VLOOKUP($A2,$A$2:$C$10,3,TRUE)))

    and drag down.

    Copy the data in the helper column and Paste Special | Values over the original column C data.

    Delete the helper column.

    To automate it, record the actions above as you carry them out. It might need some fine tweaking but that can easily be done if you need it.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    02-14-2007
    Location
    Chester, England
    MS-Off Ver
    2010 & 2016
    Posts
    312

    Re: look for empty/blank cells and copy data from another cell where the first cell..

    Hello

    if you do the following it should give you what you need based on your example......

    Assuming column A is the "lookup" value and Column C is the cell that needs to be filled.........


    Sort the data by column A and then C. A can be sorted in any way but C must be sorted to show the populated values at the top.

    Highlight Column C from the first Cell that needs to be populated down to the bottom.

    Now click "Find & Select" from the "Home" tab, then "Go To Special" and choose "Blanks"

    Now Type "=" (without quotes) and press the Up arrow

    Press CRTL and Enter and it should populate all the values for you.

    Hope this helps

    Cheers

    Jim

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: look for empty/blank cells and copy data from another cell where the first cell..

    Try this
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor johnjohns's Avatar
    Join Date
    11-19-2007
    Location
    Dubai, UAE
    MS-Off Ver
    2003 and 2007
    Posts
    526

    Re: look for empty/blank cells and copy data from another cell where the first cell..

    Also you can copy the range to another area and delete the rows with empty columns. Then do a lookup to this from the first range. See the attachment
    Attached Files Attached Files
    regards

    johnjohns

    When you are not sure where to go, every road takes you there!

+ 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