• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 315
  • Last Modified:

text function in vba excel

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..
  • 2
2 Solutions
Hitesh ManglaniCommented:
check the second spreadsheet there must be a compile error in the code
Hitesh ManglaniCommented:
on second thoughts there is no Text function in excel vba, you can however use worksheetfunction
refer this link
Chris BottomleySoftware Quality Lead EngineerCommented:
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.


IbDyhrAuthor Commented:
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!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now