View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default printing using vba; listbox/command button

Please don't post in more then one group

--
Regards Ron de Bruin
http://www.rondebruin.nl


"bkey01 " wrote in message ...
I have an Excel workbook containing over 40 sheets with each having at
least 7 pages setup to print out in the page setup area.

I have multiple listboxes setup to goto specific cell that contain the
start of each page.

I am trying to write a code in vb using a listbox and command button to
print certain pages from different sheets. i.e. On sheet 1, I want to
print the information that starts in cell a50 and ends in aa110 and
then on sheet2, I want to print the information that starts in cell a15
and ends in aa32 and so on.

Example of code I have tried:
if listbox1.selected(0) then goto errhandler1
listbos1.selected(0) = false

errhandler1:
sheet1.range(a50:aa110).printout
end sub

THIS DID NOT WORK FOR ME!

Can someone please help me with this.

Thanks in advance.


---
Message posted from http://www.ExcelForum.com/