Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro that prints after recalc is finished

Hi,

I've got a relatively large spreadsheet (25 MB) with a lot of formulas
(some of them are UDFs). Most of the calculation is done in a sheet
called "data", the summary is presented in sheet "Report", which only
has about a couple of dozens of Sumifs but that's about it.

The purpose of that file is to allow the user to key in an order number
value in cell B5 after which all the recalcs kick in. It usually takes
about 15 secs to recalc, sometimes might take longer or shorter.

Now one of the users asked me to print summaries for all order numbers,
which is about a thousand. I can't imagine doing it manually, so I've
got to write a macro to do it. I can see looping through the order
numbers and printing the summary page for each one.

However, I don't know how to ensure that the summary page is printed
only after all recalculations are finished, otherwise it might print a
bunch of summaries with partially calculated formulas and then I'll get
crusified.

Could anyone give me some clue as to how to achieve this.

Thanks in advance.

I work with Excel XP

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Macro that prints after recalc is finished

Do you have a list of all the order numbers somewhere?

If you do, you could loop through that list, do a recalc, print, and go to the
next order number.

I put my list in A2:A### of sheet1. I only printed Sheet2.

Option Explicit
Sub testme01()

Dim myCell As Range
Dim myOrderRng As Range

With Worksheets("sheet1")
Set myOrderRng = .Range("a2", .Cells(.Rows.Count, "A").End(xlUp))
End With

For Each myCell In myOrderRng.Cells
Worksheets("sheet2").Range("B5").Value = myCell.Value
Application.Calculate
Worksheets("sheet2").PrintOut preview:=True
Next myCell

End Sub

In fact, I did a print preview (for testing).

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm


wrote:

Hi,

I've got a relatively large spreadsheet (25 MB) with a lot of formulas
(some of them are UDFs). Most of the calculation is done in a sheet
called "data", the summary is presented in sheet "Report", which only
has about a couple of dozens of Sumifs but that's about it.

The purpose of that file is to allow the user to key in an order number
value in cell B5 after which all the recalcs kick in. It usually takes
about 15 secs to recalc, sometimes might take longer or shorter.

Now one of the users asked me to print summaries for all order numbers,
which is about a thousand. I can't imagine doing it manually, so I've
got to write a macro to do it. I can see looping through the order
numbers and printing the summary page for each one.

However, I don't know how to ensure that the summary page is printed
only after all recalculations are finished, otherwise it might print a
bunch of summaries with partially calculated formulas and then I'll get
crusified.

Could anyone give me some clue as to how to achieve this.

Thanks in advance.

I work with Excel XP


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Please Help: Macro Nearly Finished Dave Excel Discussion (Misc queries) 1 September 20th 07 12:16 PM
Loop until finished. David A. Excel Discussion (Misc queries) 0 September 17th 07 08:00 PM
½ symbol prints a 2 and Winding square box prints a F frank-e Excel Discussion (Misc queries) 2 March 22nd 06 10:03 PM
Need macro that selects an item off pivot page filter, prints, se. hoppermr2004 Excel Programming 1 August 30th 04 02:55 PM
Defining an auto-open macro that prints specific worksheets sam[_3_] Excel Programming 1 November 21st 03 08:52 PM


All times are GMT +1. The time now is 04:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"