+ Reply to Thread
Results 1 to 4 of 4

Copying cells that meet certain criteria and pasting into columns

  1. #1
    Registered User
    Join Date
    03-24-2016
    Location
    New York, New York
    MS-Off Ver
    Office Professional Plus 2013
    Posts
    2

    Copying cells that meet certain criteria and pasting into columns

    Hello everyone! I have moderate experience with Excel but new to VBA.
    In Sheet 1, I have one column that contains 1000+ cells with names, phone numbers, and email data. I want to make a VBA module that will search each cell in the column, and if the cell meets certain criteria, copy the cell and paste it to columns in Sheet 2.

    My Sheet 1 data column looks like this:
    John Smith
    [email protected]
    111-222-3456 cell
    222-333-4567 office


    Jane Smith
    [email protected]
    333-444-5678 home

    And I want it to be copied into a sortable table in sheet 2:
    Name............. Phone................Email
    John Smith 111-222-3456 [email protected]
    Jane Smith 333-444-5678 [email protected]

    How do I write a module that can pick out the cells that meet criteria, copy and paste them into the correct column in Sheet 2? For example, if a cell in Sheet 1 contains an "@" symbol, I want the module to copy and paste that cell to the Email column in Sheet 2. I don't know what criteria I can use for Name, except that each name has at least 3 empty rows that come before it. So in that case, how can I select each Sheet 1 cell that has 3+ empty rows above it, and copy and paste it into the Names column of Sheet 2?

    I don't know if my module should be a function, sub, or what... I don't understand how to use most of the code terminology (dim, range, how to indicate that an action is to be performed on Sheet 1 or Sheet 2) in tutorials and similar posts in this forum. I can provide more detail to anyone that can help!
    Thank you!

  2. #2
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Copying cells that meet certain criteria and pasting into columns

    The best thing you could to help us help you is to post a small sample of what you're working with. Change all of the private data, obviously, and shorten it down to a handful of entries, but makes sure that the arrangement of the data matches the real thing.

    Side question: when there are multiple phone numbers, you only want the first one listed?

  3. #3
    Registered User
    Join Date
    03-24-2016
    Location
    New York, New York
    MS-Off Ver
    Office Professional Plus 2013
    Posts
    2

    Re: Copying cells that meet certain criteria and pasting into columns

    Yes, just the first phone number. Here is an example file. I want to be able to fill out the columns on the right (First name, last name, etc.) using the data listed in column 1.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Copying cells that meet certain criteria and pasting into columns

    Give this one a shot...

    Please Login or Register  to view this content.

+ 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. How to delete columns that meet one criteria AND does NOT meet the other?
    By lch93lily in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 08-06-2014, 09:53 AM
  2. Display (different) warnings if any cells in certain columns meet criteria
    By ks100 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-31-2013, 09:57 AM
  3. [SOLVED] Question regarding copying data that meet two criteria to another worksheet
    By lilsnoop in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-02-2013, 10:11 PM
  4. [SOLVED] Copying rows that meet two criteria to another worksheet
    By Proteus414 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-28-2013, 05:00 PM
  5. Copying Rows that meet criteria/criterion
    By protoking17 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-06-2013, 09:27 AM
  6. Copying all rows that meet a criteria to another worksheet
    By nzkazza in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-19-2012, 05:53 AM
  7. Finding and copying rows that meet key word criteria
    By acrobaticgod in forum Excel General
    Replies: 12
    Last Post: 10-29-2011, 05:35 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