Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to Print specific cells with formatting
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
HOW DO I NOT PRINT SPECIFIC CELLS IN EXCELL | Excel Discussion (Misc queries) | |||
print button macro & specific tabs to print | Excel Worksheet Functions | |||
Setting Specific Cells To Not Print | Excel Discussion (Misc queries) | |||
print specific cells | Excel Discussion (Misc queries) | |||
Macro to Print to a specific bin | Excel Programming |