Results 1 to 4 of 4
  1. #1
    ATTHECROSS is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Posts
    14

    What VBA Would I Use To Center A Heading Over Multiple Columns In An Access Report?

    Hello All -

    I am setting up reports that I will export by a click button and I am trying to center the heading for the various reports over multiple columns. Does anyone know the VBA I would use to carry out this task?

    Thanks for the help in advance!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I'm not clear on what you're doing. if you center them as desired in design view, they should keep that when exported to PDF.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ATTHECROSS is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Posts
    14
    I am exporting the reports to excel by VBA, which will open a new excel workbook and a new tab for each report within that workbook. So I need to have the headings of each report tab to span column A to column M.

    Hope this helps.

    Thanks

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    In my experience, exporting a report to Excel results in a mess. A simple one might come out okay, but I gave up. I typically export the underlying query. If the headings are consistent, I'd use a template spreadsheet and export the data starting under the header. When I need to do the formatting as I export, I use Excel automation, which would let you do that centering. The template is probably simplest though.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 08-12-2016, 10:37 AM
  2. Replies: 1
    Last Post: 04-18-2016, 11:48 AM
  3. Multiple Columns report
    By marysilvaramos in forum Reports
    Replies: 1
    Last Post: 01-09-2013, 01:49 PM
  4. report zoom in center
    By raton in forum Reports
    Replies: 3
    Last Post: 04-03-2012, 11:26 PM
  5. Report will not center on page
    By AKQTS in forum Reports
    Replies: 3
    Last Post: 10-21-2010, 12:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums