+ Reply to Thread
Results 1 to 2 of 2

Copy values from selected columns to another worksheet based on one condition

  1. #1
    Registered User
    Join Date
    08-16-2019
    Location
    Alicante
    MS-Off Ver
    MS 2019
    Posts
    6

    Copy values from selected columns to another worksheet based on one condition

    Hello everyone,

    Purpose: To extract data from certain columns in worksheet "BOLETA" and copy it to specifc columns in worksheet "Customer". There is also one condition to take into consideration - I only want to copy data from the rows where Column C is empty (meaning has no customer code).

    I want to create a code that will do following things in this order:
    1. Remove data existing data from worhsheet "Customer"

    I believe this should work fine for that: Range("A5:AJ" & Rows.Count).ClearContents

    2. Then for all rows where Column C is empty,
    - copy values from column J, K, O of worksheet "BOLETA" and copy it to Columns B, D, F respectively of the worksheet "Customer" (starting from row 5)

    3. Then for column J of the worksheet "Customer" insert text "Project 1" also starting from row 5 until the end of data

    4. Then for column Z of the worksheet "Customer" insert formula vlookup(AA;´Post Code´!B:E;4;false)


    any help will be much appreciated (i think 3 and 4 I can figure out somehow myself but the point 2 drives me crazy)

  2. #2
    Registered User
    Join Date
    08-16-2019
    Location
    Alicante
    MS-Off Ver
    MS 2019
    Posts
    6

    Re: Copy values from selected columns to another worksheet based on one condition

    and I just realised I need one more condition but it is primary condition:
    All above rows data should only be copied if value in column I (it contain unique value - ID of the customer), within range of rows that do not have customer code (those with column c empty) is not already present in rows with customer code (column C not empty). It is to avoid copying rows of customers that already exist.

+ 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 selected column based on selected value to new worksheet
    By ladydee94 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-16-2017, 02:36 AM
  2. Copy Filtered Selected columns to new worksheet
    By irajeev in forum Excel General
    Replies: 13
    Last Post: 07-23-2015, 11:15 PM
  3. Copy Rows to another Worksheet Based on a Condition
    By patxlb in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-06-2013, 04:57 PM
  4. Replies: 10
    Last Post: 06-06-2013, 12:10 AM
  5. Replies: 4
    Last Post: 01-19-2013, 03:16 AM
  6. Copy Selected Cells of Rows to another Worksheet Based on a Condition
    By Al53 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2010, 10:33 PM
  7. copy data from 1 worksheet to another based on a condition
    By vinisunodh@gmail.com in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-04-2006, 08:20 AM

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