Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default printing with a command button

I want to print 20 consecutive cells using a command button on my
page.
Can someone help me?
  #2   Report Post  
Posted to microsoft.public.excel.misc
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default printing with a command button

Not sure exactly what you want, but this may help....

Sub Print20()
Range("A5:A24").Select
ActiveSheet.PageSetup.PrintArea = "$A$5:$A$24"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("A5").Select
End Sub

Vaya con Dios,
Chuck, CABGx3



" wrote:

I want to print 20 consecutive cells using a command button on my
page.
Can someone help me?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default printing with a command button

We can even take that a step further, making it more generic so that what
ever cell is currently selected becomes the top cell in a range that includes
20 cells in the selected cell's column:
Sub Print20()
ActiveSheet.PageSetup.PrintArea = _
Selection.Address & ":" & Selection.Offset(19, 0).Address)
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
'and set the PrintArea back to the entire sheet
ActiveWindow.SelectedSheets.PageSetup.PrintArea = ""
End Sub


Dim whereAmI As String
whereAmI = Selection.Address
Range(Selection.Address & ":" & Selection.Offset(19, 0).Address).Select
Stop
Range(whereAmI).Select


"CLR" wrote:

Not sure exactly what you want, but this may help....

Sub Print20()
Range("A5:A24").Select
ActiveSheet.PageSetup.PrintArea = "$A$5:$A$24"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("A5").Select
End Sub

Vaya con Dios,
Chuck, CABGx3



" wrote:

I want to print 20 consecutive cells using a command button on my
page.
Can someone help me?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default printing with a command button

On Feb 1, 9:56*am, JLatham <HelpFrom @ Jlathamsite.com.(removethis)
wrote:
We can even take that a step further, making it more generic so that what
ever cell is currently selected becomes the top cell in a range that includes
20 cells in the selected cell's column:
Sub Print20()
* * ActiveSheet.PageSetup.PrintArea = _
* * * Selection.Address & ":" & Selection.Offset(19, 0).Address)
* * ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
'and set the PrintArea back to the entire sheet
* *ActiveWindow.SelectedSheets.PageSetup.PrintArea = ""
End Sub

* Dim whereAmI As String
* whereAmI = Selection.Address
* Range(Selection.Address & ":" & Selection.Offset(19, 0).Address).Select
* Stop
* Range(whereAmI).Select



"CLR" wrote:
Not sure exactly what you want, but this may help....


Sub Print20()
* * Range("A5:A24").Select
* * ActiveSheet.PageSetup.PrintArea = "$A$5:$A$24"
* * ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
* * Range("A5").Select
End Sub


Vaya con Dios,
Chuck, CABGx3


" wrote:


I want to print 20 consecutive cells using a command button on my
page.
Can someone help me?- Hide quoted text -


- Show quoted text -


I will try these ideas on the week end. Thank you so much to both of
you.
Ron Binette
  #5   Report Post  
Posted to microsoft.public.excel.misc
CLR CLR is offline
external usenet poster
 
Posts: 594
Default printing with a command button

You're welcome.........holler back if you have problems.........a lot of us
are here even on the weekends <sigh

Vaya con Dios,
Chuck, CABGx3


wrote in message
...
On Feb 1, 9:56 am, JLatham <HelpFrom @ Jlathamsite.com.(removethis)
wrote:
We can even take that a step further, making it more generic so that what
ever cell is currently selected becomes the top cell in a range that

includes
20 cells in the selected cell's column:
Sub Print20()
ActiveSheet.PageSetup.PrintArea = _
Selection.Address & ":" & Selection.Offset(19, 0).Address)
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
'and set the PrintArea back to the entire sheet
ActiveWindow.SelectedSheets.PageSetup.PrintArea = ""
End Sub

Dim whereAmI As String
whereAmI = Selection.Address
Range(Selection.Address & ":" & Selection.Offset(19, 0).Address).Select
Stop
Range(whereAmI).Select



"CLR" wrote:
Not sure exactly what you want, but this may help....


Sub Print20()
Range("A5:A24").Select
ActiveSheet.PageSetup.PrintArea = "$A$5:$A$24"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("A5").Select
End Sub


Vaya con Dios,
Chuck, CABGx3


" wrote:


I want to print 20 consecutive cells using a command button on my
page.
Can someone help me?- Hide quoted text -


- Show quoted text -


I will try these ideas on the week end. Thank you so much to both of
you.
Ron Binette


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
Command Button Help Kenny Excel Discussion (Misc queries) 2 October 15th 07 03:29 AM
How to add a command button Marilyn Excel Discussion (Misc queries) 3 August 3rd 06 01:44 AM
Printing Access reports through Excel command button? Ed Excel Discussion (Misc queries) 0 June 7th 06 03:52 PM
Command Button on User form for Printing Anthony Slater Excel Discussion (Misc queries) 2 September 7th 05 02:01 PM
Command Button Chris Hale Excel Discussion (Misc queries) 1 February 10th 05 05:14 AM


All times are GMT +1. The time now is 08:14 AM.

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

About Us

"It's about Microsoft Excel"