ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Application.Dialogs(xlDialogPrint).Show (https://www.excelbanter.com/excel-programming/439513-application-dialogs-xldialogprint-show.html)

Luc[_8_]

Application.Dialogs(xlDialogPrint).Show
 
Hoi there,

I want to use the code "Application.Dialogs(xlDialogPrint).Show", but by
default i would like that 'All the worksheets" are selected when this
dialog opens.

Can it be done ???


Thanks,

Luc


Charabeuh[_4_]

Application.Dialogs(xlDialogPrint).Show
 
Hello

To select a worksheet and to made it the selected worksheet:
Worksheets("MyName").select

To select a worksheet and to add it to the actual selection of worksheets :
Worksheets("MyName").select False

To select all the worksheet:

Sub SelectAllWorksheets()
Dim xW As Worksheet

Worksheets(1).Select
For Each xW In Worksheets
xW.Select False
Next xW

End Sub










"Luc" a écrit dans le message de groupe de discussion :
...
Hoi there,

I want to use the code "Application.Dialogs(xlDialogPrint).Show", but by
default i would like that 'All the worksheets" are selected when this
dialog opens.

Can it be done ???


Thanks,

Luc



Rick Rothstein

Application.Dialogs(xlDialogPrint).Show
 
This seems to work...

Application.Dialogs(xlDialogPrint).Show 2,1,ThisWorkbook.Sheets.Count

--
Rick (MVP - Excel)


"Luc" wrote in message
...
Hoi there,

I want to use the code "Application.Dialogs(xlDialogPrint).Show", but by
default i would like that 'All the worksheets" are selected when this
dialog opens.

Can it be done ???


Thanks,

Luc



K_Macd

Application.Dialogs(xlDialogPrint).Show
 
Luc

Group selection of a number of sheets is a nice feature especially for
printing but note that it can also be a very dangerous feature and that I
suggest that after closing the print dialog you have code to select only one
sheet so as to avoid corruption in active but not visible sheets.

Within the print dialog there is the ability to select the whole workbook -
a better idea would be to be able to open the dialog with that option set and
if someone can enlighten one on how I would be very pleased.
--
Ken
"Using Dbase dialects since 82"
"Started with Visicalc in the same year"


"Rick Rothstein" wrote:

This seems to work...

Application.Dialogs(xlDialogPrint).Show 2,1,ThisWorkbook.Sheets.Count

--
Rick (MVP - Excel)


"Luc" wrote in message
...
Hoi there,

I want to use the code "Application.Dialogs(xlDialogPrint).Show", but by
default i would like that 'All the worksheets" are selected when this
dialog opens.

Can it be done ???


Thanks,

Luc


.


Rick Rothstein

Application.Dialogs(xlDialogPrint).Show
 
See inline comments...

Group selection of a number of sheets is a nice feature especially for
printing but note that it can also be a very dangerous feature and that I
suggest that after closing the print dialog you have code to select only
one
sheet so as to avoid corruption in active but not visible sheets.


No where in my posting did I select all the sheets in the workbook (not did
I say the user should do that manually either)... the single line of code I
posted simply calls up the print dialog box with the option to print all the
sheets selected **in the dialog box only**... this does not select any
sheets in the workbook nor is it dependent on that being done.

Within the print dialog there is the ability to select the whole
workbook -
a better idea would be to be able to open the dialog with that option set
and
if someone can enlighten one on how I would be very pleased.


I actually had that option working... once... but when I experimented with
other settings, I found I could no longer make the "select whole workbook"
option work again. Not being sure why this was the case, I figured it was
safer to offer the method I posted which always worked for me no matter what
other settings I tried.

--
Rick (MVP - Excel)


This seems to work...

Application.Dialogs(xlDialogPrint).Show 2,1,ThisWorkbook.Sheets.Count


I want to use the code "Application.Dialogs(xlDialogPrint).Show", but
by
default i would like that 'All the worksheets" are selected when this
dialog opens.

Can it be done ???




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

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