+ Reply to Thread
Results 1 to 6 of 6

VBA Macro Dynamic Find Array, Copy and Paste only Certain Values based on Condition

  1. #1
    Registered User
    Join Date
    10-11-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    45

    VBA Macro Dynamic Find Array, Copy and Paste only Certain Values based on Condition

    Hi,

    Im looking for assistance with my vba and hoping someone can assist with meeting my requirements below. It is the dynamic part of the code (identfying and only copying set rows) that i am struggling with.

    In summary I have 2 files 'Weekly Sales (Identify Comp).xlsx' and 'Weekly Sales Report.xlsm'. The 'Weekly Sales (Identify Comp).xlsx' is the extract of data and with some tweaking i want to copy the data into the file 'Weekly Sales Report.xlsm'.

    So getting into the detail, firstly you will see within the excel document titled 'Weekly Sales (Identify Comp).xlsx' that there is a long list of companies. For my output i dont need the entire list of companies all i need are the 'Competitor' companies. I need all the columns of the data. So thats the first step, secondly with the file being an aggregated file where the last reporting week will be added each week to the extract, i would also like to if possible be able to use an input (cell highlighted in 'yellow') in the 'Weekly Sales Report.xlsm' to set the week that i would like to extract.

    Any help would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    06-08-2012
    Location
    Lagos, Nigeria
    MS-Off Ver
    Excel 2007, 2010, 2016
    Posts
    102

    Re: VBA Macro Dynamic Find Array, Copy and Paste only Certain Values based on Condition

    Hey rjnc,

    Please find attached the code i code come up with (had help with code snippets acquired over the years ). Check if this meets your need. I added sub Test in module 2 for your review.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    10-11-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: VBA Macro Dynamic Find Array, Copy and Paste only Certain Values based on Condition

    Quote Originally Posted by kay007 View Post
    Hey rjnc,

    Please find attached the code i code come up with (had help with code snippets acquired over the years ). Check if this meets your need. I added sub Test in module 2 for your review.
    Thanks so much! This is exactly what i was after!!

  4. #4
    Forum Contributor
    Join Date
    06-08-2012
    Location
    Lagos, Nigeria
    MS-Off Ver
    Excel 2007, 2010, 2016
    Posts
    102

    Re: VBA Macro Dynamic Find Array, Copy and Paste only Certain Values based on Condition

    Cool. Please mark the thread as resolved.

  5. #5
    Registered User
    Join Date
    10-11-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: VBA Macro Dynamic Find Array, Copy and Paste only Certain Values based on Condition

    Quote Originally Posted by kay007 View Post
    Cool. Please mark the thread as resolved.
    Sorry kay007 i have been having issues amending the code to suit the structure of the report. What i am needing is to paste the Competitor 1-3 information in separate tables. Where I have been having issues is with the length, i can get it to paste in the corresponding table, however when it is pasting the values it is only pasting the data to the length of Column A, instead of the end of the table. Do you know how to resolve? Many thanks.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-11-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: VBA Macro Dynamic Find Array, Copy and Paste only Certain Values based on Condition

    Quote Originally Posted by kay007 View Post
    Cool. Please mark the thread as resolved.
    Sorry kay007 i have been having issues amending the code to suit the structure of the report. What i am needing is to paste the Competitor 1-3 information in separate tables. Where I have been having issues is with the length, i can get it to paste in the corresponding table, however when it is pasting the values it is only pasting the data to the length of Column A, instead of the end of the table. Do you know how to resolve? Many thanks.
    Attached Files Attached Files

+ 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 data based on predefined condition and paste them to an "array"
    By shu001 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-27-2015, 03:09 PM
  2. [SOLVED] Copy and paste (values) to another sheet based on condition
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-09-2013, 10:25 PM
  3. Excel Macro to insert two rows based on condition and copy and paste multiple cells
    By mannabhalo in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-13-2012, 12:56 PM
  4. paste RNG numbers
    By kaohik78 in forum Excel General
    Replies: 0
    Last Post: 09-26-2012, 10:30 PM
  5. VBA macro to Find a dynamic range of cells, copy then paste to another sheet
    By Bmxerdude2087 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-24-2012, 02:36 PM
  6. Copy and Paste Special Values Macro ignoring cells with specific condition
    By chendriks47 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-06-2011, 03:01 AM
  7. [SOLVED] Macro Syntax to copy and paste dynamic data based on one column
    By jbsand1001 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-17-2005, 10:06 AM

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