Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Print range & Command Button

TimN, I used your code and it worked on my system. The only thing I changed
was instead of sheets("data") I used Sheets(1).

"TimN" wrote:

I have one sheet named Data and another sheet that contains two command
buttons. I want to press Command Button1 and have a print out of range
A1:G20 from the Data sheet. When I press Command Button2 I want a print out
of range A25:L35 from the Data sheet.

I recorded a macro from the sheet where my print buttons are to see the
code. It is as follows:
Sub Macro1()
Sheets("Data").Select
Range("A1:G20").Select
Selection.PrintOut Copies:=1, Collate:=True
Sheets("Print Buttons").Select
End Sub

I then created the command buttons and applied that code with the respective
ranges for each button, but it created an error.

When I press my print command buttons, I get a print out of a blank page,
not the data in the respective ranges. What am I doing wrong?

Thanks for any help.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
print 20 cells with a command button [email protected] Excel Discussion (Misc queries) 5 February 3rd 08 05:57 PM
Print from Command Button Range Garyw Excel Discussion (Misc queries) 8 May 3rd 07 09:17 PM
command button print RKS Excel Discussion (Misc queries) 0 March 23rd 07 10:59 AM
Print Workbook Command Button Sprinks Excel Programming 3 January 25th 06 07:55 PM
command button-print Jeff Excel Programming 0 October 12th 04 06:45 PM


All times are GMT +1. The time now is 07:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"