hello please help me on this how to make the first letter of each word in uppercase.hoping for your positive responds...thanks in advance

Dani AI

Generated

Useful follow-up and platform-specific notes. pointed out the built-in classic-VB option, which is perfectly fine for VB6/VBA. If working in Visual Basic .NET, prefer a culture-aware approach so accented letters and locale rules behave correctly.

A simple VB.NET pattern is to normalize the case first and then apply the culture TextInfo title-casing:

Dim ti = System.Globalization.CultureInfo.CurrentCulture.TextInfo
Dim result As String = ti.ToTitleCase(input.ToLower())

A few practical tips that often matter in real data:

  • ToTitleCase treats words that are already all-caps as acronyms and may leave them unchanged. Calling ToLower before ToTitleCase yields more consistent results for mixed-case input.
  • Hyphenated names, prefixes like Mc/Mac, and apostrophes often need extra handling. Post-process those tokens (split on "-", "'" or use a regex) and apply title-casing to each segment, or maintain an exceptions list for known patterns.
  • Preserve acronyms and technical terms by restoring them from a small whitelist after casing (for example: "HTML", "SQL").
  • If performance matters, cache and reuse the CultureInfo/TextInfo instance rather than recreating it for every string.

For classic VB/VBA reference see the language documentation on the built-in conversion function, and for .NET behavior and the acronym exception note see the TextInfo.ToTitleCase documentation:

Thanks to for the pointer and to for the follow-up confirmation.

Recommended Answers

All 2 Replies

Use the StrConv function:

Text1.Text = StrConv(Text1.Text, vbProperCase)

vbProperCase converts the first letter of every word in string to uppercase.

Other constants are vbUpperCase, vbLowerCase, vbUnicode, and vbFromUnicode.

hello thanks for helping me more power to you..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.