Learn Advanced VBScript from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

VBA Function - INSTR

Karthik Dale
26/04/2017 0 0

INSTR works similar to FIND function in Excel. INSTR search for specific text in a given text and returns the position number of what you are searching for.

Syntax: InStr( [start_num], string, searchingfor, [compare] )

Sub INSTR_1()

MsgBox InStr(1, "Narendra Modi", " ")

'Output: 9

MsgBox InStr(1, "Narendra Modi", "Modi")

'Output: 10

MsgBox InStr(1, "Narendra Modi", "MODI")

'Output: 0

'To find the 2nd "e" postion number in "excel is awesome"

MsgBox InStr(InStr(1, "excel is awesome", "e") + 1, "excel is awesome", "e")


'Note: INSTR function is a case-sensitive and if it's not found the value then output will be 0

End Sub

0 Dislike
Follow 0

Please Enter a comment


Other Lessons for You

About Us
To fulfill the dream of Govt. of India, ”Information Technology for everyone”, and to fulfill the needs of 28 Lakhs IT professional till 2017 and other jobs related to this factor and giving...

A chart is a set of coordinates When you make a chart you start with an empty, two-dimensional space, a vertical dimension (y) and a horizontal dimension (x) . You also have a data source. Your job is...

Top 30 formulas in Excel
Generally, we are only use maximum "30 formulas" in our day to day routine. let's explore with below formulas and let me know which one is your favorite. Vlookup If Iferror Sum Count Sumif Countif CountA Index Match Left Right Mid Tri...

Clipboard Task Pane
When you copy a cell's contents, formula or format, that information goes into the clipboard. The clipboard will hold the information until you decide to paste it somewhere else on the spreadsheet,...

Arrange and View Multiple Worksheets at Once in Excel
Arrange and View Multiple Worksheets at Once in Excel This feature allows you to view multiple worksheets at once from the same workbook at the same time. You need to follow beneath simple...

Looking for Advanced VBScript Training?

Learn from Best Tutors on UrbanPro.

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you

Looking for Advanced VBScript Classes?

The best tutors for Advanced VBScript Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Advanced VBScript with the Best Tutors

The best Tutors for Advanced VBScript Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more