lesser-equity

Computer Juice Magazine
Go Back   Computer Juice > Computer Software > Office Suites & Applications



Reply
 
Thread Tools
  #1  
Old 1st Mar 2008, 05:42
New Member Group
 
Posts: 8
Default Print Macro

I need to know how to create a macro so that when i press a command button a wrksheet will print two copies of the cell range.

Thanks

  #2  
Old 1st Mar 2008, 05:48
Donor Group
 
Skill Level: Beginner
Posts: 722
Default Print Macro

Have you selected a spreadsheet program to do this in yet?
__________________

My System: Tim

Processor(s):
Athlon 64 3500+
Motherboard:
Asus A8N-VM CSM
RAM Memory:
Corsair PC3200 CL2 DDR-400 2GB
Graphics Card(s):
nVidia Geforce 6600 512MB
Sound Card:
Cherry RS 6000 M keyboard
Hard Drive(s):
Barracuda.7+ 2x200GB 58MB/s sustain
Optical Drive(s):
Samsung DVD-ROM TS-H352
Case / PSU:
Thermaltake Soprano
Cooling:
Stock
Network / Internet:
Telewest 2x20Mb/sec
Monitor(s):
SXGA flat panel
Operating System(s):
Slackware (2.6.27.7) (Fluxbox)
  #3  
Old 1st Mar 2008, 05:49
New Member Group
 
Posts: 8
Default Print Macro

yeh sorry its in excel
  #4  
Old 1st Mar 2008, 06:03
Donor Group
 
Skill Level: Beginner
Posts: 722
Default Print Macro

Any particular version of excel? I hate to be pushy but.
  #5  
Old 1st Mar 2008, 06:27
New Member Group
 
Posts: 8
Default Print Macro

well at home im usin 2007, but im out atm so im usin 2003 where i am atm
  #6  
Old 1st Mar 2008, 06:31
Donor Group
 
Skill Level: Beginner
Posts: 722
Default Print Macro

okay, this ought to work on both.

Sub PrintRange()
'
' PrintRange Macro
' This will print 2 copies of a worksheet preselected range
'
Application.ScreenUpdating = False
Sheets("Sheet1").Select
ActiveSheet.Unprotect
ActiveWindow.Range("C5:D17").PrintOut Copies:=2
Application.ScreenUpdating = True
End Sub

If you have trouble creating a button or hooking the code to it then say and we'll talk you through it.
  #7  
Old 8th Mar 2008, 04:35
New Member Group
 
Posts: 8
Default Print Macro

Sorry for a delayed response. Thanks I will try this and will give you feedback as soon as possible :)
  #8  
Old 8th Mar 2008, 05:03
Donor Group
 
Skill Level: Beginner
Posts: 722
Default Print Macro

What's in that example is fairly random, I've no idea whether you've multiple sheets or you've protected areas or you want to end up somewhere different after the macro's run than where you were when you clicked it. Or whether your worksheet range is based on labels or on hard cell addresses. I suggest you play with the syntax a bit, the line that does all the work is

ActiveWindow.Range("C5:D17").PrintOut Copies:=2

and you can change that to your heart's content.
  #9  
Old 8th Mar 2008, 05:36
New Member Group
 
Posts: 8
Default Print Macro

Thanks for the help guys... I have done it now.

Please support this forum, donate towards our running costs.
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Print servers doesn't work Bildr Networking, Modems & VoIP 5 29th Mar 2008 09:14
Print Screen function VJH Digital Imaging & Printers 7 7th Dec 2007 15:15

Tags
macro, print

Bookmarks
Thread Tools



Arabic Bulgarian Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Finnish French German Greek Hebrew Hungarian Italian Japanese Korean Norwegian Polish Portuguese Romanian Russian Serbian Slovak Spanish Swedish Thai Turkish

Copyright ©2006 - 2009 Computer Juice.

Powered by vBulletin® Copyright ©2000 - 2009 Jelsoft Enterprises Ltd. SEO by vBSEO ©2009, Crawlability, Inc.