+ Reply to Thread
Results 1 to 7 of 7

Fill/Copy Down Blank Cells Issue

  1. #1
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Fill/Copy Down Blank Cells Issue

    I'm trying to fill down various columns based on the cell value above it, and have found various examples in how do so including the below macro.

    But what I'm finding is that this does not always work. I have found that for cells that are formatted as Text, the macro returns the =R[-1]C instead the correct cell value.

    Please Login or Register  to view this content.
    Is there a way to fill blank cells without having to first change the formatting back to General?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Fill/Copy Down Blank Cells Issue

    Hello ptmuldoon,

    This works...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: Fill/Copy Down Blank Cells Issue

    Thanks Leith,

    I gave that code a try, however that seemed to copy the value in the first row down to the last in the selection overwriting any values in the middle. It should be copying down to the next non-blank cell, and then starting over with the new value it finds filling the blanks to the the next non blank.

    I know these 2 samples I found partially work. but if the cell is formatted as text, it returns the "=R[-1]C" when it should be returning the cell value of that first non blank above it.

    Both of these work if the cell if formatted as General. But if the formatting is Text it fails.
    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: Fill/Copy Down Blank Cells Issue

    Sorry to give this a bump, but i'm still struggling to solve this issue.

    I'm trying to copy down to the next non-blank cell, and then continue on copying down, etc. And as mentioned above, these macro's work, but only if the cell is in a 'general' format. For those cells with text formatting, I'm getting a "=R[-1]C" value in the cell, incorrectly.

    Does anyone know of a way to copy/fill down the blank cells when the cell is formatted as Text?

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Fill/Copy Down Blank Cells Issue

    Hello ptmuldoon,

    When a cell is formatted as Text, Excel will not evaluate the contents of the cell. Either you will have to change the cell's format to General or use VBA to paste the value into the cell.

    Since I failed to understand your example as you intended, I suggest you submit a workbook with before and after examples.

  6. #6
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: Fill/Copy Down Blank Cells Issue

    Sure. Here's an example of what I'm seeing and should help clarify things.

    I think I just learned something too. It appears to be affected only if its the blank cells that are formatted at text.

    So I think maybe just need to first format all blank cells back to general. Then you can copy the first non-blank cell down to the next filled one, etc.
    Attached Files Attached Files

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

    Re: Fill/Copy Down Blank Cells Issue

    Here's an option that works irregardless.

    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. [SOLVED] Macro to fill blank cells in column A based on non-blank cells
    By ktalamantez in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2014, 02:47 PM
  2. 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
  3. 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
  4. [SOLVED] Copy cells to fill in blank fields
    By RevJeff in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-13-2012, 11:43 AM
  5. Copy down - special to fill only the blank cells
    By Mike in forum Excel General
    Replies: 3
    Last Post: 04-18-2005, 06: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