Sample of Excel VBA String Manipulation and Split Function:
See more - Excel VBA Sample CodeDeclare the variable - Split VBA & Visual Studio Tools for Office
Dim SVar as stringSVar=”Crack, Cracking, program, software, Dll, hacks, Serials, Key Generators, Activation, Keygen, pirate Informatique, antivirus online, Excel VBA, Excel Tools, Excel Add-ins, image assistant, picture manager for Excel, Spreadsheet Image Tools, products, manage pictures, macro code”
This var save separate words with commas
With the VBA Split() function you can retrieve the separate words
How to use the Excel SPLIT function with examples.
SPLIT function VBA – syntax.
SPLIT function split a string into substrings on a delimiter
Parameters
Expression, The string to split
Delimiter, The delimiter to split
Use the function in Excel vba macro code (Microsoft Visual Basic Applications - Editor)
The syntax in Excel VBA is: Split ( expression [,delimiter] [,limit] [,compare] )The siyntax in Visual Studio Tools Office 2017 code is equal - for alternative development in Visual Studio 2017.
In this Example, the delimiter is the comma (;)
The string words have separated with comma
The first string part is: Crack Tools
The second string part is: Cracking Tools
The syntax is to retrieve the separated string is:
Dim newSvar as string()
newSvar retrieve any array with separated words
newSvar =Split(Svar,”,”)
This is the result:
Sample1:
newSvar(0)= “Crack Tools”
newSvar(1)= “Cracking Tools”
newSvar(n)=other string”
Sample2:
Split("A,B,C,D", ",")
Result: {"A", "B", "C", "D"}
Sample3:
Dim L1 As String, L2() As String
L1 = "site.com"
L2 = Split(L1, ".")
MsgBox LArray(0) ‘… Site
MsgBox LArray(1) ‘… .com
No hay comentarios:
Publicar un comentario