ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to Print specific cells with formatting (https://www.excelbanter.com/excel-programming/362449-macro-print-specific-cells-formatting.html)

Clark

Macro to Print specific cells with formatting
 
I want to creat a Macro to Print a specific area, while formatting that
information into a clean and visually appealing appearance.

The area is from C2 to I2 and from rows 2 to 91. When it prints, I just
want to see the information without the gridlines.

Finally, I want the code to run from a Macro button you just "click to print"

Clark

Tom Ogilvy

Macro to Print specific cells with formatting
 
In page setup, go to the last tab and unselect gridlines.

Private sub Commandbutton1_Click()
Range("C2:I91").printout
End Sub


or
Private sub Commandbutton1_Click()
activesheet.pagesetup.Printgridlines = False
Range("C2:I91").printout
End Sub

if you want to set it in code.
--
Regards,
Tom Ogilvy


"Clark" wrote:

I want to creat a Macro to Print a specific area, while formatting that
information into a clean and visually appealing appearance.

The area is from C2 to I2 and from rows 2 to 91. When it prints, I just
want to see the information without the gridlines.

Finally, I want the code to run from a Macro button you just "click to print"

Clark


Clark

Macro to Print specific cells with formatting
 
Thanks Tom,

This is my first Macro, so can I create a "button" with this code and place
it on the worksheet?

Clark

"Tom Ogilvy" wrote:

In page setup, go to the last tab and unselect gridlines.

Private sub Commandbutton1_Click()
Range("C2:I91").printout
End Sub


or
Private sub Commandbutton1_Click()
activesheet.pagesetup.Printgridlines = False
Range("C2:I91").printout
End Sub

if you want to set it in code.
--
Regards,
Tom Ogilvy


"Clark" wrote:

I want to creat a Macro to Print a specific area, while formatting that
information into a clean and visually appealing appearance.

The area is from C2 to I2 and from rows 2 to 91. When it prints, I just
want to see the information without the gridlines.

Finally, I want the code to run from a Macro button you just "click to print"

Clark


Tom Ogilvy

Macro to Print specific cells with formatting
 
no, why would you want to create a button with code. You said you wanted to
execute this macro using a button. Place a button on the worksheet from the
control toolbox toolbar and double click on it. this will take you to the
click event.

Make the event look like this (insuring you use the correct name for the
button - this is an example)

Private sub Commandbutton1_Click()
me.pagesetup.Printgridlines = False
me.Range("C2:I91").printout
End Sub

then come back to excel an in the control toolbox toolbar, click the Top
Left button to take your workbook out of design mode. Now if you click the
button, it should print the range.

--
Regards,
Tom Ogilvy


"Clark" wrote:

Thanks Tom,

This is my first Macro, so can I create a "button" with this code and place
it on the worksheet?

Clark

"Tom Ogilvy" wrote:

In page setup, go to the last tab and unselect gridlines.

Private sub Commandbutton1_Click()
Range("C2:I91").printout
End Sub


or
Private sub Commandbutton1_Click()
activesheet.pagesetup.Printgridlines = False
Range("C2:I91").printout
End Sub

if you want to set it in code.
--
Regards,
Tom Ogilvy


"Clark" wrote:

I want to creat a Macro to Print a specific area, while formatting that
information into a clean and visually appealing appearance.

The area is from C2 to I2 and from rows 2 to 91. When it prints, I just
want to see the information without the gridlines.

Finally, I want the code to run from a Macro button you just "click to print"

Clark


Clark

Macro to Print specific cells with formatting
 
Thanks Tom,

Ok, so I am not that bright. I did this, but nothing happens when I click
the button.

"Tom Ogilvy" wrote:

no, why would you want to create a button with code. You said you wanted to
execute this macro using a button. Place a button on the worksheet from the
control toolbox toolbar and double click on it. this will take you to the
click event.

Make the event look like this (insuring you use the correct name for the
button - this is an example)

Private sub Commandbutton1_Click()
me.pagesetup.Printgridlines = False
me.Range("C2:I91").printout
End Sub

then come back to excel an in the control toolbox toolbar, click the Top
Left button to take your workbook out of design mode. Now if you click the
button, it should print the range.

--
Regards,
Tom Ogilvy


"Clark" wrote:

Thanks Tom,

This is my first Macro, so can I create a "button" with this code and place
it on the worksheet?

Clark

"Tom Ogilvy" wrote:

In page setup, go to the last tab and unselect gridlines.

Private sub Commandbutton1_Click()
Range("C2:I91").printout
End Sub


or
Private sub Commandbutton1_Click()
activesheet.pagesetup.Printgridlines = False
Range("C2:I91").printout
End Sub

if you want to set it in code.
--
Regards,
Tom Ogilvy


"Clark" wrote:

I want to creat a Macro to Print a specific area, while formatting that
information into a clean and visually appealing appearance.

The area is from C2 to I2 and from rows 2 to 91. When it prints, I just
want to see the information without the gridlines.

Finally, I want the code to run from a Macro button you just "click to print"

Clark


Tom Ogilvy

Macro to Print specific cells with formatting
 
Best I can do is send you a sample workbook if you want to contact me with a
valid email address at

--
Regards,
Tom Ogilvy


"Clark" wrote:

Thanks Tom,

Ok, so I am not that bright. I did this, but nothing happens when I click
the button.

"Tom Ogilvy" wrote:

no, why would you want to create a button with code. You said you wanted to
execute this macro using a button. Place a button on the worksheet from the
control toolbox toolbar and double click on it. this will take you to the
click event.

Make the event look like this (insuring you use the correct name for the
button - this is an example)

Private sub Commandbutton1_Click()
me.pagesetup.Printgridlines = False
me.Range("C2:I91").printout
End Sub

then come back to excel an in the control toolbox toolbar, click the Top
Left button to take your workbook out of design mode. Now if you click the
button, it should print the range.

--
Regards,
Tom Ogilvy


"Clark" wrote:

Thanks Tom,

This is my first Macro, so can I create a "button" with this code and place
it on the worksheet?

Clark

"Tom Ogilvy" wrote:

In page setup, go to the last tab and unselect gridlines.

Private sub Commandbutton1_Click()
Range("C2:I91").printout
End Sub


or
Private sub Commandbutton1_Click()
activesheet.pagesetup.Printgridlines = False
Range("C2:I91").printout
End Sub

if you want to set it in code.
--
Regards,
Tom Ogilvy


"Clark" wrote:

I want to creat a Macro to Print a specific area, while formatting that
information into a clean and visually appealing appearance.

The area is from C2 to I2 and from rows 2 to 91. When it prints, I just
want to see the information without the gridlines.

Finally, I want the code to run from a Macro button you just "click to print"

Clark



All times are GMT +1. The time now is 01:12 PM.

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