Article ID: 121818
Article Last Modified on 6/11/2007
Sub Print_Area()
Dim My_Range As String
On Error Resume Next 'enables error handling
My_Range = InputBox("Enter the name of the area to print:")
'if Cancel is chosen then InputBox returns empty string
If Len(My_Range) > 0 Then Range(My_Range).PrintOut
If Err > 0 Then MsgBox "Name or range specified is not valid."
End Sub
163435 VBA: Programming Resources for Visual Basic for Applications
Additional query words: 5.00c XL97 XL7 XL5 XL
Keywords: kbdtacode kbhowto kbprint kbprogramming KB121818