ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   problem with..end with selection (https://www.excelbanter.com/excel-programming/344211-problem-end-selection.html)

Pierre via OfficeKB.com[_2_]

problem with..end with selection
 
Hi experts,

i have this simple code but it does not seem to work.

With Sheets("Output")
.Visible = True
.Range("A1:F56").Select
.PrintPreview
.Visible = False
End With

I just want a preview of the selected range("A1:F56")......

can anybody help me please ?
Thanks,
Pierre


--
Message posted via http://www.officekb.com

Bob Phillips[_6_]

problem with..end with selection
 
Hi Pierre,

I thinks that this might be what you want

With Sheets("Output")
.Visible = True
.PageSetup.PrintArea = "$A$1:$F$27"
.PrintPreview
.Visible = False
End With


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Pierre via OfficeKB.com" <u13950@uwe wrote in message
news:569d8f80c5dda@uwe...
Hi experts,

i have this simple code but it does not seem to work.

With Sheets("Output")
.Visible = True
.Range("A1:F56").Select
.PrintPreview
.Visible = False
End With

I just want a preview of the selected range("A1:F56")......

can anybody help me please ?
Thanks,
Pierre


--
Message posted via http://www.officekb.com




Mika Oukka

problem with..end with selection
 
Hi,

Add the line no 3 to the code.

- Mika

With Sheets("Output")
.Visible = True
.Select
.Range("A1:F56").Select
.PrintPreview
.Visible = False
End With

"Pierre via OfficeKB.com" <u13950@uwe wrote in message
news:569d8f80c5dda@uwe...
Hi experts,

i have this simple code but it does not seem to work.

With Sheets("Output")
.Visible = True
.Range("A1:F56").Select
.PrintPreview
.Visible = False
End With

I just want a preview of the selected range("A1:F56")......

can anybody help me please ?
Thanks,
Pierre


--
Message posted via http://www.officekb.com




Pierre via OfficeKB.com[_2_]

problem with..end with selection
 
thanks Bob...again!
Your code works fine !
Pierre

Bob Phillips wrote:
Hi Pierre,

I thinks that this might be what you want

With Sheets("Output")
.Visible = True
.PageSetup.PrintArea = "$A$1:$F$27"
.PrintPreview
.Visible = False
End With

Hi experts,

[quoted text clipped - 12 lines]
Thanks,
Pierre



--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200510/1


All times are GMT +1. The time now is 10:38 AM.

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