Monday, October 7, 2013

VBA String Functions - Part 3

LCASE Function (VBA)

In Microsoft Excel, the LCASE function converts a string to lower-case.

Syntax

The syntax for the LCASE function is:

LCase( text )
Text is the string that you wish to convert to lower-case.

VBA Function Example

The LCASE function can only be used in VBA code in Microsoft Excel. Here are some examples of what the LCASE function would return:

LCase("ALPHABET") would return "alphabet"
LCase("Google SearcH") would return "google search"
LCase("124ABC") would return "124abc"


Dim sResult As String
sResult = LCase("This is a TEST")

In this example, the variable called sResult would now contain the value "this is a test".



UCASE Function (VBA)

In Microsoft Excel, the UCASE function converts a string to all upper-case.

Syntax

UCase( text )
text is the string that you wish to convert to upper-case.

VBA Function Example

The UCASE function can only be used in VBA code in Microsoft Excel. Here are some examples of what the UCASE function would return:

UCase("vbAexPress.blogspot.In") would return "VBAEXPRESS.BLOGSPOT.IN"
UCase("Alphabet") would return "ALPHABET"


Dim sResult As String
sResult = UCase("This is a TEST")

In this example, the variable called sResult would now contain the value "THIS IS A TEST".


No comments:

Post a Comment

Data base function

Database function Daverage function      Averages the values in a field (column) of records in a list or database that match conditio...