Ozgrid Excel Help & Best Practices Forums

Excel Training / Excel Dashboards Reports

Results 1 to 2 of 2

Thread: Calculate sheet and sheet of in Excel 2010

  1. #1
    Join Date
    4th January 2012

    Calculate sheet and sheet of in Excel 2010

    I finally got things figured out (with some help here) regarding the formula and function code to number the sheets in my workbook as 1 of 3, 2 of 3, 3 of 3 etc. Now..... when I move the file over to Excel 2010 I error out. The formulas work fine in Excel 2003 XP. The Error Note indicates "Invalid Name Error" and when I to to help on error or Error Checking Options, I still do not know what I need to do. Do I need to give the cells on the first worksheet a Name?

    If someone could explain what Excel is asking me to do, define - I'm ready to be educated! Regards - Lenny2

    On each worksheet there are two cells: for example (A1 is [=SheetPosition()] and A3 is [=GetSheetCount()]

    The code in 'This Workbook' is:
    Function SheetPosition() As Integer 
        Application.Volatile True 
        SheetPosition = Application.Caller.Parent.Index 
    End Function 

    Function SheetCount (Optional Worksheets_Only As Boolean) As Long 
        If Worksheets_only = True Then 
            SheetCount = Worksheets.Count 
            SheetCount = Sheets.Count 
        End If 
    End Function 
    Last edited by Lenny2; February 23rd, 2012 at 10:10.

    Excel Video Tutorials / Excel Dashboards Reports

  2. #2
    Join Date
    19th January 2007
    South Carolina, USA

    Re: Calculate sheet and sheet of in Excel 2010


    Hopefully, you have take the time to read the forum rules, which require that you use code tags any time you post VBA code.
    Please make an immediate edit to your post to add the code tags.

    Easiest way; highlight all of the code then click the button the # symbol.

    If you prefer to manually add the codes, then
    How to use code tags

    your code goes between these tags


    Forum Rules | Message to Cross Posters | How to use Tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Possible Answers

  1. Excel Sheet compare from multiple sheet and paste the values
    By irfanparbatani in forum Excel General
    Replies: 2
    Last Post: December 20th, 2011, 08:18
  2. Problem with vba code for excel 2010 main menu sheet
    By buddy2013 in forum Excel General
    Replies: 5
    Last Post: November 27th, 2011, 03:02
  3. Replies: 4
    Last Post: September 30th, 2011, 02:45
  4. Replies: 2
    Last Post: June 13th, 2011, 17:00
  5. Copy a table from an excel sheet to an Embedded Excel Chart Object's Sheet
    By avtarxing in forum Excel and/or Powerpoint Help
    Replies: 1
    Last Post: June 17th, 2010, 00:18


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts