Inserting Excel sheet into the beginning

Posted on 2006-04-14
Last Modified: 2010-04-23
good day.

i have an application that creates many sheets within a workbook.  i use:

myXLSheet = myxlBook.Sheets.Add(After:=myxlBook.Worksheets(myxlBook.Worksheets.Count))

to add each sheet.

i have a summary sheet that comes at the end and i need to get it into the very beginning.... i have tried using Before:  instead of After: but haven't had any luck.  can someone please let me know the parameters for .Add(Before:=) to get my summary sheet as the first sheet within the workbook?

thank you.

Question by:freezingHot
    LVL 44

    Accepted Solution

    Hello freezingHot,

    myXLSheet = myxlBook.Sheets.Add(Before:=myxlBook.Worksheets(1)))

    hope this helps a bit
    LVL 1

    Author Comment

    thank you.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
    Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now