Public Function Sample_VBA_Functions() Dim text Dim list As Variant A = "1234567894" B = " Someone took my Cat " c = "House,Car,Cat,Dog,Pig" text = text & vbCrLf & "Dim List as Array" text = text & vbCrLf & "A = ""1234567894""" text = text & vbCrLf & "B = "" Someone took my Cat """ text = text & vbCrLf & "C = ""House,Car,Cat,Dog,Pig""" text = text & vbCrLf text = text & vbCrLf & "Left(A,3) = " & Left(A, 3) text = text & vbCrLf & "Right(A,3) = " & Right(A, 3) text = text & vbCrLf & "Mid(A,5,3) = " & Mid(A, 5, 3) text = text & vbCrLf & "Instr(A,""4"") = " & InStr(A, "4") text = text & vbCrLf & "Instr(A,""41"") = " & InStr(A, "41") text = text & vbCrLf & "InstrRev(A,""4"") = " & InStrRev(A, "4") text = text & vbCrLf & "Lcase(B) = " & LCase(B) text = text & vbCrLf & "Ucase(B) = " & UCase(B) text = text & vbCrLf & "Trim(B) = " & Trim(B) text = text & vbCrLf text = text & vbCrLf & "List = Split(C,"","")" list = Split(c, ",") text = text & vbCrLf & "LBound(List) = " & LBound(list) text = text & vbCrLf & "UBound(List) = " & UBound(list) For i = LBound(list) To UBound(list) text = text & vbCrLf & " List(" & i & ") = " & list(i) Next i text = text & vbCrLf text = text & vbCrLf & "Replace(B,""took"",""got"") = " & Replace(B, "took", "got") text = text & vbCrLf & "Len(A) = " & Len(A) text = text & vbCrLf & "isNull(Nothing) = " & IsNull(Nothing) text = text & vbCrLf text = text & vbCrLf & "Now = " & Now() text = text & vbCrLf & "Year(now()) = " & Year(Now()) text = text & vbCrLf & "Month(Now()) = " & Month(Now()) text = text & vbCrLf & "Day(now()) = " & Day(Now()) text = text & vbCrLf & "Hour(now()) = " & Hour(Now()) text = text & vbCrLf & "Minute(now()) = " & Minute(Now()) text = text & vbCrLf & "DateDiff(""D"", now(),Date(""July 26, 2007"")) = " & DateDiff("d", Now(), "July 26, 2007") text = text & vbCrLf text = text & vbCrLf & "Round(23.459994555) = " & Round(23.459994555) text = text & vbCrLf & "Abs(-34) = " & Abs(-34) text = text & vbCrLf & "Cos(3.14159) = " & Cos(3.14159) text = text & vbCrLf & "Sin(3.14159) = " & Sin(3.14159) text = text & vbCrLf & "Tan(1.707) = " & Tan(1.707) text = text & vbCrLf & "Sqr(9) = " & Sqr(9) text = text & vbCrLf text = text & vbCrLf & "Format(Now(),""MMM D, YYYY"") = " & Format(Now(), "MMM D, YYYY") text = text & vbCrLf & "IIF(True,""Apple"",""Pear"") = " & IIf(True, "Apple", "Pear") text = text & vbCrLf & "IIF(False,""Apple"",""Pear"") = " & IIf(False, "Apple", "Pear") text = text & vbCrLf & "Asc(""A"") = " & Asc("A") text = text & vbCrLf & "Chr(65) = " & Chr(65) text = text & vbCrLf text = text & vbCrLf & "CreateObject(""Application.Excel"")" MsgBox text End Function