search
HomeSoftware TutorialOffice SoftwareFind Chinese characters in text using VB

Find Chinese characters in text using VB

Jan 07, 2024 am 10:10 AM
Find character function in vbvb find text chinese charactersvb find text

VB Find Chinese Characters in Text

Private Sub Command1_Click()

Dim AR() As String, AR2() As String

sTxt = "2 01 01 00 00 00 00 00 00 00 F4 44 0C 00 08 01 29 01 03 00 00 00 00 00 00 00 F4 44 0C 00 08 01 D3 01 04 00 00 00 00 00 00 00 F4 44 0C 00 08 01 2A 01 06 00 00 00 00 00 00 00 F4 44 0C 00 08 01"

AR = Split(sTxt, "D3 01")

L = LBound(AR) 1

U = UBound(AR)

For i = L To U

tmp = Trim(AR(i))

AR2 = Split(tmp, " ")

'Output

Me.Print AR2(LBound(AR2)) & Space(2);

Next i

End Sub

VB Find Text

First question: There needs to be one button and two textboxes

Private Sub Command1_Click()

Dim a As Integer

a = InStr(1, Text1.Text, Text2.Text, vbTextCompare)

Text1.SetFocus

Text1.SelStart = a - 1

Text1.SelLength = Len(Text2.Text)

End Sub

Second question:

Private Sub Command1_Click()

Dim a As Integer

a = InStr(1, Text1.Text, Text2.Text, vbTextCompare)

If a > 0 Then

Text1.SetFocus

Text1.SelStart = a - 1

SendKeys "{down}"

End If

End Sub

Do your own research as needed, hehe

VB text search problem

3 text boxes, 1 button

text1 is the text, text2 displays the results, text3 needs to find the text

Private Sub Command1_Click()

Dim p As Long, s As Long

Dim L As String

p = -1

Do While True

s = p 2

p = InStr(s 1, Text1.Text, vbCrLf)

If p = 0 Then

Text1.SelStart = s - 1

Text1.SelLength = Len(Text1.Text) - s 1

Else

Text1.SelStart = s - 1

Text1.SelLength = p - s 1

End If

If InStr(1, Text1.SelText, Text3.Text) > 0 Then

If Text2.Text = "" Then

Text2.Text = Text1.SelText

Else

Text2.Text = Text2.Text & vbCrLf & Text1.SelText

End If

End If

If p = 0 Then Exit Do

Loop

End Sub

The above is the detailed content of Find Chinese characters in text using VB. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:Excel办公网. If there is any infringement, please contact admin@php.cn delete
How to archive in Outlook automatically or manuallyHow to archive in Outlook automatically or manuallyApr 16, 2025 am 11:48 AM

This comprehensive guide explains how to effectively manage your Outlook email storage by archiving emails, tasks, and other items across various Outlook versions (365, 2021, 2019, 2016, 2013, and earlier). Learn to configure automatic archiving, pe

Excel: Compare strings in two cells for matches (case-insensitive or exact)Excel: Compare strings in two cells for matches (case-insensitive or exact)Apr 16, 2025 am 11:26 AM

The tutorial shows how to compare text strings in Excel for case-insensitive and exact match. You will learn a number of formulas to compare two cells by their values, string length, or the number of occurrences of a specific character, a

How to back up Outlook emails automatically or manuallyHow to back up Outlook emails automatically or manuallyApr 16, 2025 am 11:17 AM

This comprehensive guide ensures your Outlook data remains safe and accessible. Learn how to back up Outlook emails, contacts, calendar entries, and tasks—both automatically and manually—across all Outlook 365 and 2010 versions. The importance of re

Excel TRIM function  - quick way to remove extra spacesExcel TRIM function - quick way to remove extra spacesApr 16, 2025 am 10:16 AM

This tutorial shows you quick and easy ways to remove extra spaces in Excel. Learn how to eliminate leading, trailing, and excess spaces between words, troubleshoot the TRIM function, and discover alternative solutions. Facing duplicate detection fa

How to remove blank spaces in Excel  - leading, trailing, non-breakingHow to remove blank spaces in Excel - leading, trailing, non-breakingApr 16, 2025 am 09:05 AM

This tutorial shows you how to eliminate unwanted spaces in Excel using formulas and the handy Text Toolkit. Learn to remove leading and trailing spaces, extra spaces between words, non-breaking spaces, and other non-printing characters. The biggest

5 Open-Source Alternatives to Microsoft Excel5 Open-Source Alternatives to Microsoft ExcelApr 16, 2025 am 12:56 AM

Excel remains popular in the business world, thanks to its familiar interfaces, data tools and a wide range of feature sets. Open source alternatives such as LibreOffice Calc and Gnumeric are compatible with Excel files. OnlyOffice and Grist provide cloud-based spreadsheet editors with collaboration capabilities. Looking for open source alternatives to Microsoft Excel depends on what you want to achieve: Are you tracking your monthly grocery list, or are you looking for tools that can support your business processes? Here are some spreadsheet editors for a variety of use cases. Excel remains a giant in the business world Microsoft Ex

Excel MATCH function with formula examplesExcel MATCH function with formula examplesApr 15, 2025 am 11:21 AM

This tutorial explains how to use MATCH function in Excel with formula examples. It also shows how to improve your lookup formulas by a making dynamic formula with VLOOKUP and MATCH. In Microsoft Excel, there are many different lookup/ref

Nested IF in Excel – formula with multiple conditionsNested IF in Excel – formula with multiple conditionsApr 15, 2025 am 11:13 AM

This tutorial demonstrates how to effectively use multiple IF functions in Microsoft Excel, showcasing nested IF formulas for various tasks. The core concept is using nested IF statements to evaluate multiple conditions and return different results

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.