ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel VBA Coding for Printing (https://www.excelbanter.com/excel-discussion-misc-queries/196096-excel-vba-coding-printing.html)

Varne

Excel VBA Coding for Printing
 
Hello

Could someone help on this?

I like to put an object on an Excel sheet. When I click it it should print a
selected range.

I tried a macro but I could go up to the pre view level only.

Thank You

M Varnendra

Ron de Bruin

Excel VBA Coding for Printing
 
Hi Varne

Use one of the one liners here
http://www.rondebruin.nl/print.htm#Liners

Maybe one of the two

Selection.PrintOut
'print only the selection

Range("C1:D5").PrintOut
'print range


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Varne" wrote in message ...
Hello

Could someone help on this?

I like to put an object on an Excel sheet. When I click it it should print a
selected range.

I tried a macro but I could go up to the pre view level only.

Thank You

M Varnendra


Varne

Excel VBA Coding for Printing
 
Hi Ron

selection.printout copies:=1, preview:=true, collate:=true

leaves with showing preview of the selection on the scree. So I have got to
push the print button to print.

What I like to have is the macro does the printing as well.

Regards
M Varnendra

"Ron de Bruin" wrote:

Hi Varne

Use one of the one liners here
http://www.rondebruin.nl/print.htm#Liners

Maybe one of the two

Selection.PrintOut
'print only the selection

Range("C1:D5").PrintOut
'print range


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Varne" wrote in message ...
Hello

Could someone help on this?

I like to put an object on an Excel sheet. When I click it it should print a
selected range.

I tried a macro but I could go up to the pre view level only.

Thank You

M Varnendra



Ron de Bruin

Excel VBA Coding for Printing
 
Use only

Selection.PrintOut

Or remove this form your code line

preview:=true



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Varne" wrote in message ...
Hi Ron

selection.printout copies:=1, preview:=true, collate:=true

leaves with showing preview of the selection on the scree. So I have got to
push the print button to print.

What I like to have is the macro does the printing as well.

Regards
M Varnendra

"Ron de Bruin" wrote:

Hi Varne

Use one of the one liners here
http://www.rondebruin.nl/print.htm#Liners

Maybe one of the two

Selection.PrintOut
'print only the selection

Range("C1:D5").PrintOut
'print range


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Varne" wrote in message ...
Hello

Could someone help on this?

I like to put an object on an Excel sheet. When I click it it should print a
selected range.

I tried a macro but I could go up to the pre view level only.

Thank You

M Varnendra



Varne

Excel VBA Coding for Printing
 
Yes Ron

It works.

Thanks.

M Varnendra

"Ron de Bruin" wrote:

Use only

Selection.PrintOut

Or remove this form your code line

preview:=true



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Varne" wrote in message ...
Hi Ron

selection.printout copies:=1, preview:=true, collate:=true

leaves with showing preview of the selection on the scree. So I have got to
push the print button to print.

What I like to have is the macro does the printing as well.

Regards
M Varnendra

"Ron de Bruin" wrote:

Hi Varne

Use one of the one liners here
http://www.rondebruin.nl/print.htm#Liners

Maybe one of the two

Selection.PrintOut
'print only the selection

Range("C1:D5").PrintOut
'print range


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Varne" wrote in message ...
Hello

Could someone help on this?

I like to put an object on an Excel sheet. When I click it it should print a
selected range.

I tried a macro but I could go up to the pre view level only.

Thank You

M Varnendra




All times are GMT +1. The time now is 02:15 PM.

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