ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro to print multiple purchase orders (https://www.excelbanter.com/excel-discussion-misc-queries/243680-macro-print-multiple-purchase-orders.html)

Cataryna

Macro to print multiple purchase orders
 
I have one file with 2 worksheets, One called PurchaseOrder (PO), the other
called PurchaseOrderData (POD). On the PO sheet I have the following:

Current Market Order 9
First Market Order to Print: 3(cell is named StartRow)
Last Market Order to Print: 6(cell is named EndRow)

I am having problems creating a macro that will print just the specified
purchase orders. Below is a macro that I copied from another help question.

Sub PrintPurchaseOrders()
'
' PrintPurchaseOrders Macro
' Prints selected range of Purchase Orders

Dim StartRow As Integer
Dim EndRow As Integer
Dim Msg As String

If StartRow EndRow Then
Msg = "ERROR" & vbCrLf & "The starting row must be less than the ending
row!"
MsgBox Msg, vbCritical, APPNAME
End If

End Sub

I'm still having problems getting it to print. Nothing at all happens when
I click the button I have assigned the macro to. Help please.




Dave Peterson

Macro to print multiple purchase orders
 
I'd start at Debra Dalgleish's site:
http://contextures.com/xlForm03.html
and even
http://contextures.com/xlForm02.html

Cataryna wrote:

I have one file with 2 worksheets, One called PurchaseOrder (PO), the other
called PurchaseOrderData (POD). On the PO sheet I have the following:

Current Market Order 9
First Market Order to Print: 3(cell is named StartRow)
Last Market Order to Print: 6(cell is named EndRow)

I am having problems creating a macro that will print just the specified
purchase orders. Below is a macro that I copied from another help question.

Sub PrintPurchaseOrders()
'
' PrintPurchaseOrders Macro
' Prints selected range of Purchase Orders

Dim StartRow As Integer
Dim EndRow As Integer
Dim Msg As String

If StartRow EndRow Then
Msg = "ERROR" & vbCrLf & "The starting row must be less than the ending
row!"
MsgBox Msg, vbCritical, APPNAME
End If

End Sub

I'm still having problems getting it to print. Nothing at all happens when
I click the button I have assigned the macro to. Help please.


--

Dave Peterson


All times are GMT +1. The time now is 09:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com