Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Formula using relative position of cells in two different worksheets David Virgil Hobbs Excel Discussion (Misc queries) 1 December 14th 06 03:36 AM
Excel Formula using relative position of cells in two different worksheets David Virgil Hobbs Excel Worksheet Functions 1 December 14th 06 03:36 AM
Look up a value which position changes. David_in_AUS Excel Discussion (Misc queries) 1 June 13th 06 09:01 AM
Setting All Worksheets To The Same Scroll Position wormdazzler Excel Worksheet Functions 2 July 20th 05 10:40 PM
Position cursor in multiple worksheets Rick[_19_] Excel Programming 4 March 5th 04 01:32 PM


All times are GMT +1. The time now is 09:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"