+ Reply to Thread
Results 1 to 6 of 6

Macro to copy from one sheet and paste in another if a condition is met.

  1. #1
    Registered User
    Join Date
    03-27-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Macro to copy from one sheet and paste in another if a condition is met.

    I am putting together a list for a wedding. I have the main list with names and address on one worksheet. Now I need to copy the name and address and paste to another worksheet for sub lists. I made a column for each sub list and put an "x" in the cell of the names that are to be copied to the other sublists. Is there a way to write a macro so that it copies the names and pastes them on the correct sublist on a different worksheet.

    thanksExample.xlsx

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Macro to copy from one sheet and paste in another if a condition is met.

    dlholland1,

    Welcome to the Excel Forum.

    If you need an additional worksheet Wedding, then let me know and I will adjust the macro code.

    Detach/open workbook DistributeRows w1 aarray wW wE wC wR - dlholland1 - EF910634 - SDG15.xlsm and run the DistributeRows macro
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Registered User
    Join Date
    03-27-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Macro to copy from one sheet and paste in another if a condition is met.

    Thanks for the help but when I try to use it on my actual list I am getting a error with the with loop saying it is out of range.

  4. #4
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Macro to copy from one sheet and paste in another if a condition is met.

    dlholland1,

    Then I will need to see the workbook/worksheet actual list, sensitive data scrubbed/removed/changed, in order to resolve the problem.

  5. #5
    Registered User
    Join Date
    03-27-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Macro to copy from one sheet and paste in another if a condition is met.

    NEW LIST2.xlsm here is the file that i am trying to do the macro in.

  6. #6
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Macro to copy from one sheet and paste in another if a condition is met.

    dlholland1,

    It is always best to start with the actual raw data workbook/worksheets.

    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    Please Login or Register  to view this content.
    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm

    Then run the DistributeRowsV2 macro.

+ 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