+ Reply to Thread
Results 1 to 10 of 10

Replacing a blank with info from cell above

  1. #1
    Registered User
    Join Date
    04-17-2009
    Location
    Eugene, OR
    MS-Off Ver
    Excel 2019
    Posts
    5

    Replacing a blank with info from cell above

    I have a long spreadsheet that is formatted and organized with six digit codes on the left, and then several lines of information on the right, in order to sort and compare to another report, I was trying to replace the blanks in the digits on the left.

    Example:

    A B C
    xxxx1 xxxxxxxx
    xxxxxxxx
    xxxxxxxx

    xxxx2 xxxxxxxx
    xxxxxxxx
    xxxxxxxx


    I originally tried an IF function (IF A2 = "", replace with the cell above) but it gave me a circular reference error because it was in the same column.

    I was hoping someone would be able to aid me with a formula or idea on how to remove the blank cells, replace them with the information from the previous cell above, and yet keep any cells that already have data in them as they are.


    Edit: Ty everyone.
    Last edited by Accountnt; 04-22-2009 at 01:33 PM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: Replacing a blank with info from cell above

    Unclear from you're example if this will work for you but give it a go

    http://www.contextures.com/xlDataEntry02.html

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Contributor
    Join Date
    10-11-2007
    Location
    Sweden
    MS-Off Ver
    365
    Posts
    251

    Re: Replacing a blank with info from cell above

    Can you post an example workbook without sensitive data?

  4. #4
    Registered User
    Join Date
    04-17-2009
    Location
    Eugene, OR
    MS-Off Ver
    Excel 2019
    Posts
    5

    Re: Replacing a blank with info from cell above

    VBA: Thanks, I saw that earlier, but I don't think it'll work for my problem.


    I'm attaching a modified spreadsheet similar to what I'm working with, and I apologize for my lackluster example before, the site reformatted my mock spreadsheet and it looks horrible.


    Rows 1-4 are what I need it to look like, and 5-15 are what the SS looks like now, so I need some way for excel to see the change in the number in Column A and adjust accordingly to fill the blanks with the new number (SS is over 10,000 lines).
    Attached Files Attached Files

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: Replacing a blank with info from cell above

    It worked for me

    Select range A5 to A15 > Press F5 > Special > blanks > in the formula bar type in = A5 > hold down Ctrl then press enter. Then select the cells > copy and paste special values

    VBA Noob

  6. #6
    Registered User
    Join Date
    04-17-2009
    Location
    Eugene, OR
    MS-Off Ver
    Excel 2019
    Posts
    5

    Re: Replacing a blank with info from cell above

    VBA: It comes close, but I get the "That command cannot be used on multiple selections" error when I attempt to copy/paste > values

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: Replacing a blank with info from cell above

    Select the full range not the old blank cells...or even the whole column

    VBA Noob

  8. #8
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,005

    Re: Replacing a blank with info from cell above

    Another easy way is to use a tempory column to solve it.
    For example, use column k to produce data, then copy & paste it to
    column A. You can see attached.

    HTH,
    WindKnife
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    06-12-2013
    Location
    TX, USA
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Replacing a blank with info from cell above

    Quote Originally Posted by VBA Noob View Post
    It worked for me

    Select range A5 to A15 > Press F5 > Special > blanks > in the formula bar type in = A5 > hold down Ctrl then press enter. Then select the cells > copy and paste special values

    VBA Noob
    This is a neat little work around. It works great for me, and I can see using this function for other work around. Thanks!

  10. #10
    Registered User
    Join Date
    07-17-2013
    Location
    chennai
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Replacing a blank with info from cell above

    very useful, Thanks

+ 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