-1

I am having some issues with printing an excel file i'm using. The file is made of a mastersheet, and several sheets that contain individual reports (using data in the mastersheet).

The sheets are generated from a template by a macro, and are automatically named. The sheet name is referenced in the sheet, and I am using Index/match to pull the data I need from the mastersheet. So this means that the tabs need to be recalculated constantly when I switch between them (and there's a little piece of VBA code that does it perfectly).

My issue is that when I want to print the individual reporting sheets, they are all printed with the same data (because their contents are not refreshed individually before printing).

Is there any way of printing them without selecting them one by one and individually printing them each time ?

I thought about some macro/vba code that would copy paste the sheets as values in another workbook, and then printing this workbook, but I'm not sure if its the optimal or quickest way of doing things. I would appreciate it if someone could help me.

Thanks !

WyPha
  • 3
  • 2
  • Read this: https://stackoverflow.com/questions/154434/how-do-you-get-excel-to-refresh-data-on-sheet-from-within-vba – AcsErno Apr 23 '18 at 11:29
  • Thanks for the answer, but that is not exactly what I'm looking for. I know that the sheets can be recalculated through vba, and i'm already doing that, using the "Workbook_SheetActivate" event. What I'm looking for is a way to print several sheets but by recalculating the sheets between each print. – WyPha Apr 23 '18 at 11:49

1 Answers1

0

Here's a start for you

  Sub S
  Dim ws as worksheet
  For each ws in worksheets
    ws.calculate
    'or call your recalc routine
    ws.printout
  next ws
  end sub
Harassed Dad
  • 4,669
  • 1
  • 10
  • 12