text function in vba excel

Posted on 2009-12-29
Last Modified: 2012-05-08
How can it be, that in one spreadsheet I have no problems with using the TEXT function, e.g.
st= TEXT(i,"001") - or simply typing ?TEXT(i,"001") in the immediate window, while in another spreadsheet I am told "Sub or Function not defined"

In Tools>References I have exactly the same references..
Question by:IbDyhr
    LVL 13

    Expert Comment

    check the second spreadsheet there must be a compile error in the code
    LVL 13

    Accepted Solution

    on second thoughts there is no Text function in excel vba, you can however use worksheetfunction
    refer this link
    LVL 59

    Assisted Solution

    by:Chris Bottomley
    Hello IbDyhr,

    I would think in this scenario you will find you have a function called TEXT in the first workbook's VBA .

    In the workbooks wherein it fails you need a similar code module and the function inserting therein.

    To display the VBE use alt + F11 and insert a normal code module from the menu in the deficient workbooks ... assuming I am right.



    Author Closing Comment

    Thanks guys!

    I am a little embarrassed, that I could not figure that out myself. Truth is I am mostly doing VBA in Access, so I was totally locked in the perception, that I had to use the TEXT function and not the FORMAT.

    Everything is fine now thanks!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
    Outlook Free & Paid Tools
    Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
    This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

    759 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

    14 Experts available now in Live!

    Get 1:1 Help Now