+ Reply to Thread
Results 1 to 6 of 6

[SOLVED] How to copy a column data in another column, ignoring the blanks

  1. #1
    Registered User
    Join Date
    09-13-2016
    Location
    Paris
    MS-Off Ver
    10
    Posts
    3

    [SOLVED] How to copy a column data in another column, ignoring the blanks

    Hello,

    Let me get right into my question:

    In column A I have a list of datas, but those datas are not corectly sorted, it looks like :

    875
    47

    541


    9855

    44
    2




    845


    54

    The datas are separated by blank cases, the space between 2 data is totally random, sometimes 2 datas will be right next to each other, sometimes i will have 5 empty cases between 2 datas (verticaly)

    In the column B I want to keep this exact same datas but without the empty spaces
    so my column B would look like :

    875
    47
    541
    9855
    44
    2
    845
    54

    How can I do that ?

    Thank you very much for your help.
    Max
    Last edited by Maxjprg; 09-15-2016 at 03:32 AM.

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: How to copy a column data in another column, ignoring the blanks

    Hi
    If your data is in A1:A1000, try this formula in B1 and copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-13-2016
    Location
    Paris
    MS-Off Ver
    10
    Posts
    3

    Re: How to copy a column data in another column, ignoring the blanks

    Hello,

    Thank you very much for your help.
    Unfortunatly it does not seem to work, my datas are in the column A1/A1000, I put your formula in B1, then copy down, and nothing displayed, the cases are empty.

    I should have told this in my previous mail but my datas are not numbers but words (sometimes full sentences).
    I thought maybe it was not relevant because content is still content, but I remember now that some forumlas only works with numbers.

    EDIT: I tried your formula with numbers and it does not seem to work either.
    Do I do something wrong ?

    I have excel 2013 by the way

    Thanks
    Last edited by Maxjprg; 09-14-2016 at 04:07 AM.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,771

    Re: How to copy a column data in another column, ignoring the blanks

    Here is a VBA solution.
    Please Login or Register  to view this content.
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: How to copy a column data in another column, ignoring the blanks

    Hi
    The formula I used in post #2 works perfectly with either numbers or with strings.
    See the file for clarification
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    09-13-2016
    Location
    Paris
    MS-Off Ver
    10
    Posts
    3

    Re: How to copy a column data in another column, ignoring the blanks

    Hello,

    problem was my Excel was in french and apparently formulas do not work the same way.
    I passed my excel in english and everything works fine.

    Thank you.

+ 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. Replies: 30
    Last Post: 11-06-2015, 05:43 PM
  2. [SOLVED] copy data from multiple collums into one colum ignoring blanks
    By luis6777 in forum Excel Formulas & Functions
    Replies: 36
    Last Post: 12-27-2014, 01:41 PM
  3. Return most common text from column cells with formula while ignoring blanks
    By rosco01995 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-29-2014, 03:55 AM
  4. Replies: 7
    Last Post: 10-26-2014, 06:01 PM
  5. [SOLVED] VBA Macro - Insert Rows based on different Column Value but Ignoring Blanks Cells
    By WITJ in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-12-2013, 03:11 PM
  6. Macro to sum values in one column based on data in another colum while ignoring blanks
    By The Machinist in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 11-15-2012, 03:25 PM
  7. Scan a Column A (numbers and blanks) and copy its contents WITHOUT BLANKS into Column B
    By bighandsam in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2012, 05:16 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