View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Can I shorten this?

One way:

ActiveWindow.SelectedSheets.Printout _
From:=1, _
To:=1, _
Copies:=Range("Quantity").Value, _
Collate:=True

In article ,
TyeJae wrote:

Is there a way to shorten this so that I do not have to type so much
out? Because I have a couple cells I need it to read with different
From and To's. And it would be a very long VBA.


Private Sub CommandButton1_Click()
Select Case Range("Quanity").Value
Case 1
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1,
Collate _
:=True
Case 2
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=2,
Collate _
:=True
Case 3