Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Efficient ways to copy row based on condition

  1. #11
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    16,096
    Post Thanks / Like
    Mentioned
    278 Post(s)
    Tagged
    22 Thread(s)

    Default Re: Code only copies one column

    If you are getting rid of the loop, then just add Selection before the period.
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 2003 & 2013 on Win 7

  2. #12
    Board Regular
    Join Date
    Sep 2018
    Posts
    66
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Code only copies one column

    Quote Originally Posted by Fluff View Post
    If you are getting rid of the loop, then just add Selection before the period.
    I tried that and it says that the sub is not defined.

    Code:
    Sub MM1()
    Application.ScreenUpdating = False
        Selection.AutoFilter field:=(27), Criteria1:="1"
        SpecialCells(xlCellTypeVisible).EntireRow.Copy Sheets("Vesting").Range("A1")
    Application.ScreenUpdating = True
    End Sub
    Code:
    A B C D E F G H I J K L M N O P Q R S T U V W X Y Z AA
    1 A A A A A A A A A A A A A A A A A A A A A A A A A
    2 A A A A A A A A A A A A A A A A A A A A A A A A A
    3 A A A A A A A A A A A A A A A A A A A A A A A A A
    5 A A A A A A A A A A A A A A A A A A A A A A A A A 1
    6 A A A A A A A A A A A A A A A A A A A A A A A A A 1
    7 A A A A A A A A A A A A A A A A A A A A A A A A A 1
    8 A A A A A A A A A A A A A A A A A A A A A A A A A 1
    9 A A A A A A A A A A A A A A A A A A A A A A A A A 1
    10 A A A A A A A A A A A A A A A A A A A A A A A A A 1
    That is sample data

  3. #13
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    16,096
    Post Thanks / Like
    Mentioned
    278 Post(s)
    Tagged
    22 Thread(s)

    Default Re: Code only copies one column

    I said to add selection before the period. Not remove the period.
    It should be
    Code:
    Selection.SpecialCells(xlCellTypeVisible).EntireRow.Copy Sheets("Vesting").Range("A1")
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 2003 & 2013 on Win 7

  4. #14
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    16,096
    Post Thanks / Like
    Mentioned
    278 Post(s)
    Tagged
    22 Thread(s)

    Default Re: Code only copies one column

    @srosk
    Please do not post the same question multiple times. All clarifications, follow-ups, and bumps should be posted back to the original thread. (rule 12 here: Forum Rules).
    I have merged both threads
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 2003 & 2013 on Win 7

  5. #15
    Board Regular
    Join Date
    Sep 2018
    Posts
    66
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Code only copies one column

    Quote Originally Posted by Fluff View Post
    I said to add selection before the period. Not remove the period.
    It should be
    Code:
    Selection.SpecialCells(xlCellTypeVisible).EntireRow.Copy Sheets("Vesting").Range("A1")
    Sorry, I didn't realize that 'Selection' also needed to be added, as that wasn't in your example. Anyways.. it worked. I'm very new to this. Thank you for your help.

  6. #16
    Board Regular
    Join Date
    Sep 2018
    Posts
    66
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Code only copies one column

    Quote Originally Posted by Fluff View Post
    @srosk
    Please do not post the same question multiple times. All clarifications, follow-ups, and bumps should be posted back to the original thread. (rule 12 here: Forum Rules).
    I have merged both threads
    Sorry.. thanks.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •