print range based on cell input

J

john

hi,
i have created a components list that contains all the components we
make, this components list is a single worksheet with all the parts diagrams
and ammount required. the ammount required is automatically inputted from
the calculations sheet. beside each component (80 components) i have a print
button with this code in it:

Private Sub CommandButton1_Click()

ActiveWindow.SmallScroll Down:=12
Range("A3:K55").Select
Range("K55").Activate
Selection.PrintOut Copies:=1, Collate:=True
Range("B3").Select

End Sub

this works quite well but still requires the operator to go through this
large sheet to find the components that are required and hit the print
button. some orders don't require all parts.

is it possible to have another button at the top so that if the ammount cell
(eg: c8) has a number greater than zero it will print the range:
Range("A3:K55")? the code used to do this could then be copied in 80 times
with a different ammount cell and range to give the desired result.
thanks in advance

regards
john
 
D

Don Guillett

try this ONE liner
Sub printrng()
if range("c0")>0 then range("a3:k55").Printout
End Sub
 
J

john

hi don,
this looks like what i'm after, i just want to insert it into a
button 80 time with different cell referrences. this i can't work out.
regards
john
 
D

Don Guillett

With more info, perhaps we can be of more help in your coding efforts.If
there are a lot of IFs perhaps a choose or select case macro?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top