ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   print 20 cells with a command button (https://www.excelbanter.com/excel-discussion-misc-queries/175390-print-20-cells-command-button.html)

[email protected]

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

FSt1

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


Gord Dibben

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



[email protected]

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

DS-NTE

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



Gord Dibben

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




All times are GMT +1. The time now is 11:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com