Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2011
    Posts
    1

    Unanswered: Export Access Table to Excel

    Hi everybody,

    I want to export an Access Table to an excel worsheet with particular rule. The Access table has four fields: Commercial (commercial firstname), region, category (corresponds to the product category), product and stock (numerical value). The contents of these fields is exported in the order of the above fields. Until then, it does not have any problem. The first problem that I can not solve is that whenever I meet two same data (on recordings side by side), I want that the cell remains blank.

    It's better to understand with an exampe: if the commercial Alan appears on 10 consecutive lines, I want that his name appears only in the first line (first column) and so on for the region and category fields.

    The second difficulty is how to insert a blank line at each change of business.

    To better understand my request, I've attached a copy of my Access table and the Excel file that I would get.

    In advance thank you for all your suggestions.
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2010
    Posts
    88
    This is probably more complicated than you want and I can't help feeling there must be a better solution but ... one answer would be to write some VBA code which reads your table line by line, and then writes a line of text to an output text file (as a Comma Separated Values, CSV) file.

    As you were doing that you can have code to look to see if the current value of a particular field is the same as the last printed value, and if so print "" instead.

    And print a blank lne whenever you feel like it.

    Excel will happily open a CSV file directly.

    HTH.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •