Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Excel > Printing Excel Cell Selection -Troubled Novice Needs Help


Reply
 
Thread Tools Display Modes
  #1  
Old 03-05-2004, 08:27 AM
uglykidjoey uglykidjoey is offline
Newcomer
 
Join Date: Mar 2004
Posts: 4
Unhappy Printing Excel Cell Selection -Troubled Novice Needs Help


Hi everyone!

how can i print a selection on an active worksheet in visual basic code? for example, i want to print all the values within the range A1 upto Z100?

how can i setup my printer for such action in VBA?

many thanks
Reply With Quote
  #2  
Old 03-05-2004, 08:33 AM
Jotham Jotham is offline
Newcomer
 
Join Date: Feb 2004
Posts: 16
Default

Here's an example you can work with to fit your needs.
Depending on how you want to make the request to print. Below uses a button_click to make the request.

Private Sub PrintSheet_Click()

Sheets("Name of Sheet").PageSetup.PrintArea = "$A1:Z100"
Sheets("Name of Sheet").PrintOut

End Sub
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel: Cell (Due Date) <= Date CodeRed Excel 9 11-28-2003 05:22 AM
Pause VB to select a cell in Excel. rpoy Excel 4 09-22-2003 11:20 AM
Help using automation in excel with advanced cell handling _VBA_Addict Excel 4 06-18-2003 01:48 AM
Excel Selection Probelm xzer0cool Word, PowerPoint, Outlook, and Other Office Products 1 06-06-2002 02:15 PM
Lets See Who can Do this in Excel webking Word, PowerPoint, Outlook, and Other Office Products 1 01-25-2002 08:07 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->