Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Specifying position of new Worksheets via C or VBA
How can I control the positon of a newly added worksheet added via C?
When I use the published code ThisWorkbook.Worksheets.Add( Type.Missing, Type.Missing, Type.Missing, Type.Missing) it inserts the new Worksheet after the Active Worksheet. I want to control exactly where it is inserted, probably I can tell by the parameters but don't have any explanation. I tried several things but getting error messages only. Thanks - Reinhard |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Specifying position of new Worksheets via C or VBA
The Object Browser in Excel's VB Editor has this to say:
Function Add([Before], [After], [Count], [Type]) As Object Member of Excel.Worksheets There are more details in MSDN: expression.Add(Before, After, Count, Type) expression: Required. An expression that returns one of the above objects (Sheet or Worksheet). Befo Optional Variant. An object that specifies the sheet before which the new sheet is added. After: Optional Variant. An object that specifies the sheet after which the new sheet is added. Count: Optional Variant. The number of sheets to be added. The default value is one. Type: Optional Variant. Specifies the sheet type. Can be one of the following XlSheetType constants: xlWorksheet, xlChart, xlExcel4MacroSheet, or xlExcel4IntlMacroSheet. The default value is xlWorksheet. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ Reinhard F. Bentrup wrote: How can I control the positon of a newly added worksheet added via C? When I use the published code ThisWorkbook.Worksheets.Add( Type.Missing, Type.Missing, Type.Missing, Type.Missing) it inserts the new Worksheet after the Active Worksheet. I want to control exactly where it is inserted, probably I can tell by the parameters but don't have any explanation. I tried several things but getting error messages only. Thanks - Reinhard |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Formula using relative position of cells in two different worksheets | Excel Discussion (Misc queries) | |||
Excel Formula using relative position of cells in two different worksheets | Excel Worksheet Functions | |||
Look up a value which position changes. | Excel Discussion (Misc queries) | |||
Setting All Worksheets To The Same Scroll Position | Excel Worksheet Functions | |||
Position cursor in multiple worksheets | Excel Programming |