Excel 2010 macro

Posted on 2012-09-11
Last Modified: 2012-09-14
I need help in building an excel macro where the template file and report file are in specific locations.
The template file should get data populated from the report file per specifications and then save the output as testreport_20120911_14:00:00.xls (2003-2007 format, todays date and saved time)
Also if there is any cell in the report file with comma separator, the template should take it in as new line with the cell.
Attached are the two example files.
Question by:kris_sk2012
    LVL 10

    Expert Comment

    Where will the macro find the report file? and what are the specifications for selecting it?

    Regarding the comma separator, do you mean you want it to be replaced with a new line character to create a multi-line cell?

    Author Comment

    Let's say that they both are in one directory for now. But I need an option to specify a full path once I know where they will be. So the template macro will go find for the report file in that path. And since there will be multiple files, we need the latest report file.

    Regarding comma separator, this applies to only one column and where that is true, the comma would be replaced by a new line so they are readable in new line format.
    LVL 10

    Accepted Solution

    It's easy enough to assign the directory path to a constant. When the macro looks through that directory, how will it know which file to select. Is it always the file with the newest modification time? Is it only files with names that match some criteria (say "report_*.xls*")?

    Author Comment

    For now let's say the file will be report.xls or report.xlsx
    Only one file exists. Also the directory path is constant.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
    How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
    This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
    This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now