correct syntax?

Posted on 2006-05-09
Last Modified: 2010-04-07
What is the correct syntax?

This is in Excel VB.

Dim mysheet As "activeworksheet"
Question by:ca1358
    LVL 76

    Accepted Solution

    Dim mysheet As Worksheet
    set MySheet = ActiveWorksheet
    LVL 76

    Expert Comment

    Typo. Should be

    set MySheet = ActiveSheet

    Author Comment

    Thank you!
    LVL 76

    Expert Comment

    That must be the quickest acceptance ever. I realised my error as soon as I hit Submit, but I'm a slow typist.
    LVL 76

    Expert Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
    You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

    737 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