+ Reply to Thread
Results 1 to 13 of 13

Can't paste list in a different range

  1. #1
    Registered User
    Join Date
    07-15-2018
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    6

    Can't paste list in a different range

    Hi everyone,

    So I'm trying to use an IF statement to copy a certain list onto the "value if true" part". But since this list has a different range, the values I get are not in order of the list.

    Is there a way to get the values in order on excel?


    EG:

    russian problem.png

    Now I'm trying to use the IF formula (in the C column) as such: IF(B:B="A",A:A,""). But using this formula I only get 1, 3 , 8. Is there a way for excel to select them in order so I end up getting 1, 2, 3 etc?

    Hope the explanation was clear, if not, please ask!

    Need help on this ASAP please!

    EDIT:

    Thanks for your replies! Many of you are suggesting to use a CountIf Function but this is the problem with that:

    This will only work if the list is 1,2,3 etc though. I had suggested this to simplify the problem. I have loads of data (thousands of rows) on several pages. I'm going to be using the is statement something like this in reality: =IF(A:A=0,Sheet2!A:A,""). I have managed to use the IF statement to copy out a column of 0's spaced out the same as the "destination" column. Now I am using the 0's as the "destination" and if there is a 0 present (ie a value is required to be pasted), then excel should copy out (in order) the list on Sheet2 A:A, otherwise leave it blank.

    Hope this explains it a bit better

    I have attached a sample file below, pls try to use it and see if you can figure something out
    Attached Files Attached Files
    Last edited by avkitb2; 07-16-2018 at 12:50 AM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Can't paste list in a different range

    Hi, welcome to the forum

    Regular IF statements only evaluate 1 condition. B:B is not a 1 condition, it is a range.

    I suggest that you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Can't paste list in a different range

    Hi avkitb,

    Looks like you need a CountIf Function with a dollar sign on the top row. See the attached.

    CountIf not blank.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    07-15-2018
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    6

    Re: Can't paste list in a different range

    Hi,

    Thanks!

    I have created a small sample workbook, I have attached it below:

    Hope someone can figure this out.

    Cheers
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-15-2018
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    6

    Re: Can't paste list in a different range

    Hey,

    Thanks for your reply!

    This will only work if the list is 1,2,3 etc though. I had suggested this to simplify the problem. I have loads of data (thousands of rows) on several pages. I'm going to be using the is statement something like this in reality: =IF(A:A=0,Sheet2!A:A,""). I have managed to use the IF statement to copy out a column of 0's spaced out the same as the "destination" column. Now I am using the 0's as the "destination" and if there is a 0 present (ie a value is required to be pasted), then excel should copy out (in order) the list on Sheet2 A:A, otherwise leave it blank.

    Hope this explains it a bit better

  6. #6
    Registered User
    Join Date
    07-15-2018
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    6

    Re: Can't paste list in a different range

    Quote Originally Posted by MarvinP View Post
    Hi avkitb,

    Looks like you need a CountIf Function with a dollar sign on the top row. See the attached.

    Attachment 582049
    Hey,

    Thanks for your reply!

    This will only work if the list is 1,2,3 etc though. I had suggested this to simplify the problem. I have loads of data (thousands of rows) on several pages. I'm going to be using the is statement something like this in reality: =IF(A:A=0,Sheet2!A:A,""). I have managed to use the IF statement to copy out a column of 0's spaced out the same as the "destination" column. Now I am using the 0's as the "destination" and if there is a 0 present (ie a value is required to be pasted), then excel should copy out (in order) the list on Sheet2 A:A, otherwise leave it blank.

    Hope this explains it a bit better

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Can't paste list in a different range

    Try this in C3, copied down...
    =IF(B3="a",MAX($C$2:C2)+1,"")

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Can't paste list in a different range

    Here is another 1...
    =IF(B3="A",COUNTIF($B$3:B3,"A"),"")

  9. #9
    Registered User
    Join Date
    07-15-2018
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    6

    Re: Can't paste list in a different range

    Quote Originally Posted by FDibbins View Post
    Try this in C3, copied down...
    =IF(B3="a",MAX($C$2:C2)+1,"")
    Quote Originally Posted by FDibbins View Post
    Here is another 1...
    =IF(B3="A",COUNTIF($B$3:B3,"A"),"")
    Hey thanks for your reply!

    I've just added an edit to the original post if you wouldn't mind reading through it.

    TL:DR; these functions only work if I am counting from 1, 2, 3 etc. However this is not the case, I need to paste values from a list of texts in fact

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Can't paste list in a different range

    Have you considered swapping the "A" for a cell-ref, instead?
    =IF(B3=$C$1,MAX($C$2:C2)+1,"")
    =IF(B3=$C$1,COUNTIF($B$3:B3,$C$1),"")

    If that still doesnt work, please provide a more representative sample of what you are working with - and what you want.

  11. #11
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Can't paste list in a different range

    I think my attached example above does what you want.

  12. #12
    Registered User
    Join Date
    07-15-2018
    Location
    Hong Kong
    MS-Off Ver
    2013
    Posts
    6

    Re: Can't paste list in a different range

    Quote Originally Posted by FDibbins View Post
    Have you considered swapping the "A" for a cell-ref, instead?
    =IF(B3=$C$1,MAX($C$2:C2)+1,"")
    =IF(B3=$C$1,COUNTIF($B$3:B3,$C$1),"")

    If that still doesnt work, please provide a more representative sample of what you are working with - and what you want.
    Here is a more detailed version of the sample. This is just 5 samples out of thousands, but this is exactly what I'm working with, not an example.


    In this the if statement would look something like this : if(A:A="msgstr",list!A:A,"").

    I've also attached what the end result should look like in a perfect world (where other cells are untouched), however that is nearly impossible, so I've also attached a more realistic version of what it'll look like.
    Attached Files Attached Files

  13. #13
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Can't paste list in a different range

    It looks like you want a different text each time a certain phrase if shown in A?

    If so, create a list, numbered 1 to however many texts you have, such that each text has it's own unique number...

    Lists sheet
    A
    B
    1
    1
    "???? ??????"
    2
    2
    "?? ??????? ??????"
    3
    3
    "?????? ???????????? ?? ???????? ??? ??????????? ?????? ? ??? ???????? ?????? ? ????? ????????????".
    4
    4
    "?? ??????????? ????? ???????? ??? ????? ???????".
    5
    5
    "% ??????? ? ?????????"


    Then put this in C1 and copy down...
    =IF(A1="","",VLOOKUP(COUNTIF($A$1:A1,A1),list!$A$1:$B$5,2,0))

    This is based on the COUNTIF counting how many times teh entry in A appears, so you may need 2 list s, 1 for msgid and 1 for msgstr

+ 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. Copy paste range of cells based on drop down list selection
    By jrx in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-20-2016, 10:23 AM
  2. copy & paste range from worksheet to first empty row in a list in another workbook
    By birdgirl in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-22-2015, 01:35 PM
  3. [SOLVED] Copy/paste range of cells to first empty row of active list in another worksheet
    By wildecat666 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-06-2013, 03:45 PM
  4. Replies: 8
    Last Post: 12-06-2013, 01:42 PM
  5. [SOLVED] Copy and Paste sheet into a range of sheets from list
    By adw223 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-20-2013, 01:11 PM
  6. Range Name paste List
    By rsoren38 in forum Excel General
    Replies: 1
    Last Post: 11-27-2008, 03:45 PM
  7. [SOLVED] problem with Paste-Special-Values from a List (range of cells)
    By crimsonkng in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-01-2005, 05:05 PM

Tags for this Thread

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