+ Reply to Thread
Results 1 to 7 of 7

Creating Macros for fetching data from another excel

  1. #1
    Registered User
    Join Date
    09-25-2010
    Location
    Lucknow,India
    MS-Off Ver
    Office 2019
    Posts
    15

    Creating Macros for fetching data from another excel

    Dear All,
    I was reading about macros and was wondering can i create a Macro for fetching Data in my Template file from an excel file, which i have to generate daily in evening.
    By doing so i will not have to copy paste column by column in my template , which i use to make reports.

    i have attached two sheets
    1) export sheet : which i need to export from my Company software, whose data i have to put in my template sheet.
    2) Template Sheet : in MTD Base Sheet i copy paste data in Yellow colour headers and then make Pivot to create different reports. I use Vlookups with help of master sheet in Template.

    For more Clarity In export sheet i have clearly made the table showing "from-To" column list.

    According to billings, data quantity i.e., no of rows differ every time, in export sheet.

    Thanks in advance
    Attached Files Attached Files
    Last edited by abhinavskumar; 01-17-2015 at 02:24 AM. Reason: Sample addition

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,775

    Re: Creating Macros for fetching data from another excel

    It would be easier to help if you could attach a copy of your file with a detailed explanation of what you want to do referring to specific cell and worksheets. A "before" and "after" sample of your data would also be most helpful.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    09-25-2010
    Location
    Lucknow,India
    MS-Off Ver
    Office 2019
    Posts
    15

    Re: Creating Macros for fetching data from another excel

    Dear Sir,
    i have attached two sheets
    1) export sheet : which i need to export from my Company software, whose data i have to put in my template sheet.
    2) Template Sheet : in which i copy paste data in green colour headers and then make Pivot to create different reports. I use Vlookups with help of master sheet in Template.

    According to billings, data quantity i.e., no of rows differ every time, in export sheet.
    Attached Files Attached Files

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,775

    Re: Creating Macros for fetching data from another excel

    I'm still not clear on what you want to copy. Please be specific on which columns and rows (please name them) you want to copy from the 'export' sheet and to which sheet in the template you want to copy them to.

  5. #5
    Registered User
    Join Date
    09-25-2010
    Location
    Lucknow,India
    MS-Off Ver
    Office 2019
    Posts
    15

    Re: Creating Macros for fetching data from another excel

    i have added New sheets maybe they are much clear than previous.

    In export sheet i have clearly made the table showing "from-To" column list.

    In Template i need to copy in "MTD Base" named sheet.
    Attached Files Attached Files

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,775

    Re: Creating Macros for fetching data from another excel

    OK. Now I have a clear picture of what you want to copy. The MTD BASE sheet in Template already has data in the columns you want to copy to. Do you want the columns from Export to over-write and replace what is already there or do you want to add the data from the columns in Export to the bottom of each column in MTD BASE thus leaving what is already there? Also you have rows 2 to 11 hidden from view in MTD BASE. Will the number of hidden rows ever change?

  7. #7
    Registered User
    Join Date
    12-03-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Creating Macros for fetching data from another excel

    Hey Abinav,

    I have written a small macro ("Copy_to_Template) which will copy the data from the sheet "export-new" to "Template-new" and updates the existing forumulaes in all rows of template based on the data.

    Just ensure you follow the below checks before running this macro:

    * Don't tamper with the file names keep it as "Export-new" and "Template-new"
    * Ensure both files are open while running the macro

    And run the macro "Copy_To_Template" Saved in module 2 in the Template-new file.

    Let me know if you need more modifications to it.

    If this solves your problem please mark this post as solved and add reputation.

    Regards,
    Raghu
    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. Fetching data from PDF to excel-Alignment issue
    By laxmanann in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-11-2014, 02:20 PM
  2. fetching table data from a webpage in excel using VBA
    By ad9924 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-26-2014, 02:24 AM
  3. Fetching data from link using excel macro FOR 50,0000 entries!!!!!!!!!
    By madhanmmk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-16-2013, 03:38 AM
  4. writing excel VBA Query for fetching data from Access
    By vikas.bhandari in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-16-2007, 05:47 AM
  5. creating macros in excel
    By LisaVan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2005, 07:06 PM

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