+ Reply to Thread
Results 1 to 3 of 3

Excel VBA Version Conditional Statements 2000 2003

  1. #1
    Registered User
    Join Date
    10-19-2006
    Posts
    37

    Excel VBA Version Conditional Statements 2000 2003

    Dear Excel Guru,

    I am writing to you today as the limit of my VBA'ing skills has been surpassed, and you being an excel master, I am sure you can help .

    I have got a workbook with loads of code in it. It all works fine on Excel 2003 but I have just discovered that some of the end users are using Excel 2000 and having done some testing, I have discovered 2000 (frustratingly) doesn't support tab colours. That means the following line causes my workbook to fail:

    ActiveSheet.Tab.ColorIndex = 2

    Is there a command that retrieves the version number of excel being used, so I can implement something like:

    If Version = 2003 Then
    ActiveSheet.Tab.ColorIndex = 2
    End If

    Many thanks for your help,

    James VBANoob.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good morning jw191

    Something like this should work OK :

    If Application.Version >= 10 Then
    ActiveSheet.Tab.ColorIndex = 2
    End If

    This will detect if the user is using Excel 2002 or later (where coloured tabs are supported).

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Registered User
    Join Date
    10-19-2006
    Posts
    37
    Quote Originally Posted by dominicb
    Good morning jw191

    Something like this should work OK :

    If Application.Version >= 10 Then
    ActiveSheet.Tab.ColorIndex = 2
    End If

    This will detect if the user is using Excel 2002 or later (where coloured tabs are supported).

    HTH

    DominicB

    FanDabbyTastic,

    Thanks for your help Dominic, I will give this a go,

    Cheers for the hasty reply,

    James.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1