Home

Macros and Programming

 

CardboxForumsMacros and Programming > "Combining two macro's"

Combining two macro's

I am trying to combine two macros into one, the first opens the print requester and the second saves and clears the input form of the data that has just gone to print.

Current user: [none]
Register / Log In · Help

Posted By Post

Andytymeiz

15-Jul-2013 13:05

Hi, I am trying to combine two macros into one, the first opens the print requester and the second saves and clears the input form of the data that has just gone to print. Given that the print requester window is external to the sheet, does this have to complete before the second macro can run? if so, is there a 'wait until' function available so that the data sent to print has copied out of the sheet before it is cleared?

I need to open the print requester rather than send direct to default printer so I can select output to fax, but the time taken to select the printer driver and complete the external element is variable and the concern is that if the Complete Form macro runs too early, the data will be cleared before printing has completed and thus the faxed form would be empty of data

Sub PrintForCustomer()
'
' PrintForCustomer Macro
'

'
    Sheets("Del descr (for Customer)").Select
    ActiveWindow.SelectedSheets.Application.Dialogs(xlDialogPrint).Show

End Sub

Sub CompleteForm()
'
' CompleteForm Macro
'

    ActiveWorkbook.SAVE
    Range("D12").Select
    Selection.ClearContents
    Range("D10").Select
    Selection.ClearContents
    Sheets("Del descr (for Customer)").Select
    ActiveWindow.SmallScroll Down:=36
    Range("D50").Select
    Selection.ClearContents
    Range("D46").Select
    Selection.ClearContents
    ActiveWindow.SmallScroll Down:=-12
    Range("D32:D42").Select
    Range("D42").Activate
    Selection.ClearContents
    Range("G32:G36").Select
    Range("G36").Activate
    Selection.ClearContents
    ActiveWindow.SmallScroll Down:=-15
    Range("C16").Select
    Selection.ClearContents
    Range("C13").Select
    Selection.ClearContents
    ActiveWindow.SmallScroll Down:=-12
    ActiveWorkbook.SAVE
End Sub

Any ideas would be most welcome! Am just learning how to use macros and this has got me properly puzzled.

Many thanks,

stuartsimms

15-Jul-2013 13:24

I think you probably need an Excel forum. This is for Cardbox database.

Quick Reply

Please log in or register before trying to post a reply.

 
© 2010 Cardbox Software Limited   Home