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

I received a few suggestions but the gave me errors.
I would like to create a button on a sheet to print C31 to C50 when I
press on it.
I've only one sheet called MTI.
I'd really like to make this work. Thank you if you can help me.
Ron Binette
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default print 20 cells with a command button

hi
post the code you are using.

regards
FSt1

" wrote:

I received a few suggestions but the gave me errors.
I would like to create a button on a sheet to print C31 to C50 when I
press on it.
I've only one sheet called MTI.
I'd really like to make this work. Thank you if you can help me.
Ron Binette

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default print 20 cells with a command button

Sub Print_Range()
Sheets("MTI").PageSetup.PrintArea = "$C$31:$C$50"
ActiveWindow.SelectedSheets.PrintPreview
'Change PrintPreview to PrintOut for printing
End Sub

I added the sheet name just in case you ever insert another sheet.


Gord Dibben MS Excel MVP

On Sat, 2 Feb 2008 18:39:29 -0800 (PST), wrote:

I received a few suggestions but the gave me errors.
I would like to create a button on a sheet to print C31 to C50 when I
press on it.
I've only one sheet called MTI.
I'd really like to make this work. Thank you if you can help me.
Ron Binette


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

On Feb 2, 10:19*pm, Gord Dibben <gorddibbATshawDOTca wrote:
Sub Print_Range()
* * * *Sheets("MTI").PageSetup.PrintArea = "$C$31:$C$50"
* * * * * * *ActiveWindow.SelectedSheets.PrintPreview
* * * 'Change PrintPreview to PrintOut for printing
End Sub

I added the sheet name just in case you ever insert another sheet.

Gord Dibben *MS Excel MVP



On Sat, 2 Feb 2008 18:39:29 -0800 (PST), wrote:
I received a few suggestions but the gave me errors.
I would like to create a button on a sheet to print C31 to C50 when I
press on it.
I've only one sheet called MTI.
I'd really like to make this work. Thank you if you can help me.
Ron Binette- Hide quoted text -


- Show quoted text -


I've tried that and I get this compile error.
This is how I entered it

Private Sub CommandButton1_Click()
Sub Print_Range()
Sheets("MTI").PageSetup.PrintArea = "$C$31:$C$50"
ActiveWindow.SelectedSheets.PrintOut
'Change PrintPreview to PrintOut for printing
End Sub
End Sub
What am I doing wrong?
Thank you
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default print 20 cells with a command button

Delete:
Sub Print_Range()
and one End Sub
try again....


skrev i melding
...
On Feb 2, 10:19 pm, Gord Dibben <gorddibbATshawDOTca wrote:
Sub Print_Range()
Sheets("MTI").PageSetup.PrintArea = "$C$31:$C$50"
ActiveWindow.SelectedSheets.PrintPreview
'Change PrintPreview to PrintOut for printing
End Sub

I added the sheet name just in case you ever insert another sheet.

Gord Dibben MS Excel MVP



On Sat, 2 Feb 2008 18:39:29 -0800 (PST), wrote:
I received a few suggestions but the gave me errors.
I would like to create a button on a sheet to print C31 to C50 when I
press on it.
I've only one sheet called MTI.
I'd really like to make this work. Thank you if you can help me.
Ron Binette- Hide quoted text -


- Show quoted text -


I've tried that and I get this compile error.
This is how I entered it

Private Sub CommandButton1_Click()
Sub Print_Range()
Sheets("MTI").PageSetup.PrintArea = "$C$31:$C$50"
ActiveWindow.SelectedSheets.PrintOut
'Change PrintPreview to PrintOut for printing
End Sub
End Sub
What am I doing wrong?
Thank you




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default print 20 cells with a command button

Thanks for jumping in.

Wouldn't change a word of your reply.


Gord

On Sun, 3 Feb 2008 06:44:40 +0100, "DS-NTE" wrote:

Delete:
Sub Print_Range()
and one End Sub
try again....


skrev i melding
...
On Feb 2, 10:19 pm, Gord Dibben <gorddibbATshawDOTca wrote:
Sub Print_Range()
Sheets("MTI").PageSetup.PrintArea = "$C$31:$C$50"
ActiveWindow.SelectedSheets.PrintPreview
'Change PrintPreview to PrintOut for printing
End Sub

I added the sheet name just in case you ever insert another sheet.

Gord Dibben MS Excel MVP



On Sat, 2 Feb 2008 18:39:29 -0800 (PST), wrote:
I received a few suggestions but the gave me errors.
I would like to create a button on a sheet to print C31 to C50 when I
press on it.
I've only one sheet called MTI.
I'd really like to make this work. Thank you if you can help me.
Ron Binette- Hide quoted text -


- Show quoted text -


I've tried that and I get this compile error.
This is how I entered it

Private Sub CommandButton1_Click()
Sub Print_Range()
Sheets("MTI").PageSetup.PrintArea = "$C$31:$C$50"
ActiveWindow.SelectedSheets.PrintOut
'Change PrintPreview to PrintOut for printing
End Sub
End Sub
What am I doing wrong?
Thank you


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 - Macro to print to pdf, then send pdf to email. Tdahlman Excel Discussion (Misc queries) 2 May 1st 23 11:44 AM
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
command button in excel will move when print. [email protected] Excel Discussion (Misc queries) 1 December 29th 04 03:53 PM
How do I setup a print command button in excel 2003 BigPunchy New Users to Excel 1 December 24th 04 11:54 PM


All times are GMT +1. The time now is 06:35 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"