How to Use Istext in VBA

Written by bobson st. pierre | 13/05/2017

VBA is the underlying Macro programming language used in many Microsoft products, including Microsoft Office. VBA is used to enhance, automate or customise those programs. The language is easier to learn than traditional languages. VBA, like other programming languages, contains a number of functions you can use to work with text in your programs. The Istext function is one such function you can use to validate a field for text value. Using the Istext function is simple and takes just a few steps to follow.

Open Microsoft Excel.

Place some text in cell "A1" in your Excel worksheet.

Click "Tools," "Macro," then click "Visual Basic." This will open the VBA editor.

Click "Insert," then "Module." You should now have a blank code module.

Type or copy and paste the following code into the code module:

Sub Check_For_Text()

End Sub

Press "F5" to run the program. The code will check cell range A1 in your worksheet for a text value. If text is in the cell, a message will say "It's text." If not, a message will say "It's not text."

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.