spacer.png, 0 kB
spacer.png, 0 kB
Home arrow Visual Basic arrow VBA - Macros arrow Visual Basic arrow Strings and manipulations
Strings and manipulations PDF Print E-mail


Here below some functions to manipulate strings, with the corresponding Excel version on the left side

ExcellDescription  VBA
CHAR Returns the character specified by the code number   CHR
CLEAN Removes all nonprintable characters from text
Characters 0-31, 129, 141, 143, 144, and 157
  CLEAN
CODE Returns a numeric code for the first character in a text string
If Asc("x") = y  is faster than  If Chr$(y) = "x"
  ASC
CONCATENATE   Join several strings   operatore '&' o '+'
DOLLAR Converts a number to text, using currency format   //
EXACT Checks to see if two text values are identical (case sensitive)   operatore '='
FIND Finds one text value within another (case sensitive), see also SEARCH   InStr
FIXED Formats a number as text with a fixed number of decimals   //
ISBLANK Refers to an Empty Cell, Function returns True or False   ISEMPTY
LEFT Returns the leftmost characters from a text value   LEFT
LEN Returns the number of characters in a text string   LEN
LOWER Converts text to lowercase   LCase
MID Returns a specific number of characters from a text string starting at the position you specify   MID, InStr
PROPER Capitalizes the first letter in each word of a text value   PROPER
REPT Repeats text a given number of times   REPT
(reverse) Reverses a character string   strReverse
RIGHT Returns the rightmost characters from a text value   RIGHT
SEARCH Finds one text value within another (not case sensitive)   InStr
SUBSTITUTE Substitutes new text for old text in a text string (case sensitive)   Application.Substitute
T Converts its arguments to text, =T("00123")   CStr
TEXT Formats a number and converts it to text   FORMAT
TRIM Removes spaces from text  TRIM, ltrim, rtrim    (anche TrimALL)
UPPER Converts text to uppercase   UCase
VALUE Converts a text argument to a number   VAL
Last Updated ( giovedě, 27 dicembre 2007 )
 
Next >
spacer.png, 0 kB
spacer.png, 0 kB
spacer.png, 0 kB