[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 300
  • 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..
0
IbDyhr
Asked:
IbDyhr
  • 2
2 Solutions
 
hiteshgoldeneyeCommented:
check the second spreadsheet there must be a compile error in the code
0
 
hiteshgoldeneyeCommented:
on second thoughts there is no Text function in excel vba, you can however use worksheetfunction
refer this link
http://www.excelforum.com/excel-general/379231-how-to-use-this-function.html
0
 
Chris BottomleyCommented:
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.

Regards,

chris_bottomley
0
 
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!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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