View Poll Results: Is my post useful for automating your tasks?

Voters
0. This poll is closed
  • Yes

    0 0%
  • No

    0 0%
  • Maybe

    0 0%
+ Reply to Thread
Results 1 to 5 of 5

Command Button Macro to Auto Filter, Copy from one file to another

  1. #1
    Registered User
    Join Date
    02-08-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Post Command Button Macro to Auto Filter, Copy from one file to another

    Hi All,

    Request your help in defining a macro for a command button which helps me to Autofilter and Copy from a SourceData file (w/o opening) which is stored at a location in d-drive and while pasting into another sheet (master file will have the sheets which are already created for the filtered values) it should replace the existing data in the defined range (A2:Z10).

    Requirement description is as below:-

    1. I have a file named as "RBD - " stored at a particular location in D-Drive
    2. In the master file, when I select a cell (say B2) and enter the date (in dd-mmm-yy format and is same as that of the sourcedata file name in point 1) and click the command button (Refresh) to refresh the data, macro should reach out to the stored file (sourcedata file in D-Drive) which is in the defined date format and read the contents, auto filter on column D (with filter value as Project Name) and copy the contents/rows related to that project (which are already created for those filter values) into the master file.
    3. In this process, it should also replace the existing data in the rows of the sheet in master file.
    4. If any New Filter Value is added in that SourceData sheet, then in that case, it should automatically create a new sheet with that Filtered value and copy the data as above.
    5. Instead of point 2 where the macro should reach the file automatically having the date format, it would also work if it prompts me to browse and select the sourcedata file in my computer. Once the file is browsed and selected, it should not open, but instead, it should automatically filter, copy and paste the contents as mentioned above.

    Please help me here in this regards....

  2. #2
    Registered User
    Join Date
    02-08-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Command Button Macro to Auto Filter, Copy from one file to another

    Can any one help here please?

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Command Button Macro to Auto Filter, Copy from one file to another

    Please attach a sample file .

    To Attach a File:

    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  4. #4
    Registered User
    Join Date
    02-08-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Command Button Macro to Auto Filter, Copy from one file to another

    Here are the sample files.

    WB1 is RBD is my sourcefile which I download from the central server everyday (it is stored at D:\Test\Test-1\)
    WB2 is Master - Dashboard is my Dashboard which has the CommandButtons and which I will be using it daily for my MIS (it is stored at D:\Test\Test-2\)


    WB 2 has multiple sheets for the projects which are readily listed in WB1.

    What I need is, when I click the CommandButton1 of WB2, it should automatically read (not open) WB1 and autofilter and search for project name and copy the entire contents/rows pertaining to that project (eg: CommandButton1 is for Project NVP and when I click that button it should copy the contents of NVP project into the sheet in WB2 and subsequent sheets.

    For first instance it will copy, but, from second instance, it should overwrite from Row 2 everytime this data will be refreshed (as it is my daily dashboard file, I keep on refreshing this data).

    Once it is done, my second requirement is, I will place another button beside Button1 for sending mail.

    This should automatically move or copy this sheet (NVP project sheet), save it in location (D:\Test\Test-3\) in the format as "NVP - RBD - <Current Date (dd-mmm-yy format)>", overwrite if required for the latest save.
    Attach this file and send the mail to the intended stakeholder(s) as defined.
    << To, Cc, BCc and Sub lines to be defined and contents to be edited before sending the mail >>.

    Idea is to automate the process of sharing project specific data to the concerned owner(s).

    Similar process also needs to be automated for PnL Reports as well.

    There are much more automation tasks in pipeline related and linked with this.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-08-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Command Button Macro to Auto Filter, Copy from one file to another

    Any help on this thread please?

+ 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. [SOLVED] macro for command button to copy cell content to other cells
    By Emma_B in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-19-2013, 06:32 AM
  2. [SOLVED] Macro/s to create Search Bar to filter to search terms entered activated by Command Button
    By JasonRay in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-08-2013, 03:44 PM
  3. command button- open folder and copy data from .csv file
    By karo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-01-2012, 08:17 AM
  4. Click a button, auto-save a copy of the .XLS file to a specified location?
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-03-2011, 12:45 PM
  5. Copy Sheet with Command Button to new Worbook and assign macro in new workbook
    By grey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-07-2010, 05:33 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