+ Reply to Thread
Results 1 to 4 of 4

VBA code to copy data to another sheet depending on the month

  1. #1
    Registered User
    Join Date
    03-24-2015
    Location
    Paris
    MS-Off Ver
    2007
    Posts
    2

    Question VBA code to copy data to another sheet depending on the month

    Hi everybody,

    I'm starting with VBA and I'll need some help to write a code that will allow me to copy-paste data depending on the month of the transaction.
    I have a table full of data with transactions, and I would like the code to detect and select the data for March for example, and then copy this selection to another sheet that already exist for the month of March (index n°4 in the file), it will be an April sheet (index 5) for April's transactions etc....

    I know I can do that manually, but I have thousands of data, and I was wondering if it was possible to make it faster, do you think it's possible?

    I have attached a "very" simplified version of my file.

    Thank you very much for your help
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: VBA code to copy data to another sheet depending on the month

    Why not use one formula to apply across all the worksheets? I named your sheet1 data set to Data

    =VLOOKUP(B$1,Data,MATCH($A2,Sheet1!$B$1:$C$1,0)+1,0)
    Attached Files Attached Files

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: VBA code to copy data to another sheet depending on the month

    VBA solution.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-24-2015
    Location
    Paris
    MS-Off Ver
    2007
    Posts
    2

    Re: VBA code to copy data to another sheet depending on the month

    Sorry for the late reply... and thank you for your help!

    I tried both solutions, but it's not working on my original document... Is it because I have too many columns, rows?

    I've attached a new document more detailed.

    Thank you again for your help, I really appreciate it!
    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. Macro to copy data from one sheet to another depending on name in first cell
    By subtilty in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-14-2013, 07:44 AM
  2. [SOLVED] Copy row data from one sheet to another depending on a category
    By Burli in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-24-2013, 10:13 AM
  3. VBA To copy selected data from one sheet to another depending on search box
    By leighmetcalfe in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2012, 05:52 AM
  4. copy data from sheet with dates that are within a month
    By Danimarie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2012, 07:01 AM
  5. Copy cell values depending on date (Month) in two files
    By salmanisn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-04-2010, 07:45 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