как создать книгу с одним листом строка у меня выглядет так Set CFOBook = Workbooks.Add, но создаеться 3 листа в книге
Workbooks.Add
07.06.2011 13:49:11
|
|
|
|
07.06.2011 13:53:28
удалить лишние :)
Set CFOBook = Workbooks.Add Application.DisplayAlerts = False While CFOBook.Sheets.Count <> 1 CFOBook.Sheets(1).Delete Wend Application.DisplayAlerts = True |
|
|
|
07.06.2011 13:54:58
Sub NewBook()
Application.SheetsInNewWorkbook = 1 Workbooks.Add End Sub |
|
|
|
07.06.2011 13:55:06
из секретных архивов:
Add method as it applies to the Workbooks object. Creates a new workbook. The new workbook becomes the active workbook. Returns a Workbook object. expression.Add(Template) expression Required. An expression that returns a Workbooks object. Template Optional Variant. Determines how the new workbook is created. If this argument is a string specifying the name of an existing Microsoft Excel file, the new workbook is created with the specified file as a template. If this argument is a constant, the new workbook contains a single sheet of the specified type. Can be one of the following XlWBATemplate constants: xlWBATChart, xlWBATExcel4IntlMacroSheet, xlWBATExcel4MacroSheet, or xlWBATWorksheet. If this argument is omitted, Microsoft Excel creates a new workbook with a number of blank sheets (the number of sheets is set by the SheetsInNewWorkbook property). Remarks If the Template argument specifies a file, the file name can include a path.
фрилансер Excel, VBA - контакты в
"Совершенствоваться не обязательно. Выживание — дело добровольное." Э.Деминг |
|
|
|
07.06.2011 13:56:49
Set WBN = Workbooks.Add(xlWBATWorksheet) 'создание новой книги с одним листом
|
|
|
|
25.06.2012 10:33:39
А если в команде Set WBB = Workbooks.Add(1) поменять единицу на 2 или тройку, то меняется тип книги, диаграмма или мокрокнига
|
|
|
|
25.06.2012 11:18:20
Application.SheetsInNewWorkbook = 3
Даже самый простой вопрос можно превратить в огромную проблему. Достаточно не уметь формулировать вопросы...
|
|
|
|
Читают тему