Menu Horisontal

Jumat, 11 Januari 2013

Daftar Fungsi-fungsi pada Visual Basic



Function Abs(Number)
    Member of VBA.Math
    Returns the absolute value of a number

Sub AppActivate(Title, [Wait])
    Member of VBA.Interaction
    Activates an application window

Function Asc(String As String) As Integer
    Member of VBA.Strings
    Returns the ANSI character code of the first character in a string

Function AscB(String As String) As Byte
    Member of VBA.Strings
    Returns the value of the first byte in a string

Function AscW(String As String) As Integer
    Member of VBA.Strings
    Returns the native character code of the first character in a string (Unicode or ANSI)

Function Atn(Number As Double) As Double
    Member of VBA.Math
    Returns the arctangent of a number

Sub Beep()
    Member of VBA.Interaction
    Sounds a tone through the computer's speaker

Sumber :


Function CallByName(Object As Object, ProcName As String, CallType As VbCallType, Args() As Variant)
    Member of VBA.Interaction
    Support IDispatch::Invoke

Function CBool(Expression) As Boolean
    Member of VBA.Conversion
    Converts an expression to a Boolean

Function CByte(Expression) As Byte
    Member of VBA.Conversion
    Converts an expression to a Byte

Function CCur(Expression) As Currency
    Member of VBA.Conversion
    Converts an expression to a Currency

Function CDate(Expression) As Date
    Member of VBA.Conversion
    Converts an expression to a Date



Function CDbl(Expression) As Double
    Member of VBA.Conversion
    Converts an expression to a Double

Function CDec(Expression)
    Member of VBA.Conversion
    Returns a variant with a value converted to a decimal subtype


Sub ChDir(Path As String)
    Member of VBA.FileSystem
    Changes the current or default directory on a specified drive


Sub ChDrive(Drive As String)
    Member of VBA.FileSystem
    Changes the current drive

Function Choose(Index As Single, ParamArray Choice() As Variant)
    Member of VBA.Interaction
    Selects and returns a value from a list of arguments

Function Chr(CharCode As Long)
    Member of VBA.Strings
    Returns a string containing the character associated with the specified character code

Function Chr$(CharCode As Long) As String
    Member of VBA.Strings
    Returns a string containing the character associated with the specified character code

Function ChrB(CharCode As Byte)
    Member of VBA.Strings
    Returns a string containing the specified single byte

Function ChrB$(CharCode As Byte) As String
    Member of VBA.Strings
    Returns a string containing the specified single byte


Function ChrW(CharCode As Long)
    Member of VBA.Strings
    Returns a string containing the specified native character (Unicode or ANSI)

Function ChrW$(CharCode As Long) As String
    Member of VBA.Strings
    Returns a string containing the specified native character (Unicode or ANSI)

Function CInt(Expression) As Integer
    Member of VBA.Conversion
    Converts an expression to an Integer

Function CLng(Expression) As Long
    Member of VBA.Conversion
    Converts an expression to a Long

Function Command()
    Member of VBA.Interaction
    Returns the argument portion of the command line

Function Command$() As String
    Member of VBA.Interaction
    Returns the argument portion of the command line

Function Cos(Number As Double) As Double
    Member of VBA.Math
    Returns the cosine of an angle


Function CreateObject(Class As String, [ServerName As String])
    Member of VBA.Interaction
    Creates an ActiveX object

Function CSng(Expression) As Single
    Member of VBA.Conversion
    Converts an expression to a Single

Function CStr(Expression) As String
    Member of VBA.Conversion
    Converts an expression to a String

Function CurDir([Drive])
    Member of VBA.FileSystem
    Returns the current path

Function CurDir$([Drive]) As String
    Member of VBA.FileSystem
    Returns the current path

Function CVar(Expression)
    Member of VBA.Conversion
    Converts an expression to a Variant

Function CVDate(Expression)
    Member of VBA.Conversion
    Converts an expression to a Date


Function CVErr(Expression)
    Member of VBA.Conversion
    Returns a Variant containing a user-specified error number

Function DateAdd(Interval As String, Number As Double, Date)
    Member of VBA.DateTime
    Returns a Variant containing a date to which a specified time interval has been added

Function DateDiff(Interval As String, Date1, Date2, [FirstDayOfWeek As VbDayOfWeek = vbSunday], [FirstWeekOfYear As VbFirstWeekOfYear = vbFirstJan1])
    Member of VBA.DateTime
    Returns the number of time intervals between two specified dates

Function DatePart(Interval As String, Date, [FirstDayOfWeek As VbDayOfWeek = vbSunday], [FirstWeekOfYear As VbFirstWeekOfYear = vbFirstJan1])
    Member of VBA.DateTime
    Returns a specified part of a given date

Function DateSerial(Year As Integer, Month As Integer, Day As Integer)
    Member of VBA.DateTime
    Returns a Date for a specific year, month, and day

Function DateValue(Date As String)
    Member of VBA.DateTime
    Returns a Date

Function Day(Date)
    Member of VBA.DateTime
    Returns a whole number representing the day of the week

Function DDB(Cost As Double, Salvage As Double, Life As Double, Period As Double, [Factor]) As Double
    Member of VBA.Financial
    Returns double-declining balance depreciation of an asset for a specific period

Sub DeleteSetting(AppName As String, [Section], [Key])
    Member of VBA.Interaction
    Deletes a section or key setting from an application's entry in the Windows registry entry

Function Dir([PathName], [Attributes As VbFileAttribute = vbNormal]) As String
    Member of VBA.FileSystem
    Returns the name of a matching file, directory, or folder

Function DoEvents() As Integer
    Member of VBA.Interaction
    Yields execution so that the operating system can process other events


Function Environ(Expression)
    Member of VBA.Interaction
    Returns the string assigned to an environment variable

Function Environ$(Expression) As String
    Member of VBA.Interaction
    Returns the string assigned to an environment variable

Function EOF(FileNumber As Integer) As Boolean
    Member of VBA.FileSystem
    Returns a value that indicates whether the end of a file has been reached

Function Err() As ErrObject
    Member of VBA.Information
    Returns the error number for the error that occurred

Function Error([ErrorNumber])
    Member of VBA.Conversion
    Returns the error message for a given error number

Function Error$([ErrorNumber]) As String
    Member of VBA.Conversion
    Returns the error message for a given error number

Function Exp(Number As Double) As Double
    Member of VBA.Math
    Returns e (the base of natural logarithms) raised to a power

Function FileAttr(FileNumber As Integer, [ReturnType As Integer = 1]) As Long
    Member of VBA.FileSystem
    Returns file mode for files opened using the open statement

Sub FileCopy(Source As String, Destination As String)
    Member of VBA.FileSystem
    Copies a file

Function FileDateTime(PathName As String)
    Member of VBA.FileSystem
    Returns the date and time stamp of a file

Function FileLen(PathName As String) As Long
    Member of VBA.FileSystem
    Returns the length of a file in bytes

Function Filter(SourceArray, Match As String, [Include As Boolean = True], [Compare As VbCompareMethod = vbBinaryCompare])
    Member of VBA.Strings
    Return array of matches

Function Fix(Number)
    Member of VBA.Conversion
    Returns the integer portion of a number

Function Format(Expression, [Format], [FirstDayOfWeek As VbDayOfWeek = vbSunday], [FirstWeekOfYear As VbFirstWeekOfYear = vbFirstJan1])
    Member of VBA.Strings
    Formats an expression

Function Format$(Expression, [Format], [FirstDayOfWeek As VbDayOfWeek = vbSunday], [FirstWeekOfYear As VbFirstWeekOfYear = vbFirstJan1]) As String
    Member of VBA.Strings
    Formats an expression


Function FormatCurrency(Expression, [NumDigitsAfterDecimal As Long = -1], [IncludeLeadingDigit As VbTriState = vbUseDefault], [UseParensForNegativeNumbers As VbTriState = vbUseDefault], [GroupDigits As VbTriState = vbUseDefault]) As String
    Member of VBA.Strings
    Formats expression as currency

Function FormatDateTime(Expression, [NamedFormat As VbDateTimeFormat = vbGeneralDate]) As String
    Member of VBA.Strings
    Formats expression as date

Function FormatNumber(Expression, [NumDigitsAfterDecimal As Long = -1], [IncludeLeadingDigit As VbTriState = vbUseDefault], [UseParensForNegativeNumbers As VbTriState = vbUseDefault], [GroupDigits As VbTriState = vbUseDefault]) As String
    Member of VBA.Strings
    Formats expression as number

Function FormatPercent(Expression, [NumDigitsAfterDecimal As Long = -1], [IncludeLeadingDigit As VbTriState = vbUseDefault], [UseParensForNegativeNumbers As VbTriState = vbUseDefault], [GroupDigits As VbTriState = vbUseDefault]) As String
    Member of VBA.Strings
    Formats expression as percent


Function FreeFile([RangeNumber]) As Integer
    Member of VBA.FileSystem
    Returns the next file number available for use by Open

Function FV(Rate As Double, NPer As Double, Pmt As Double, [PV], [Due]) As Double
    Member of VBA.Financial
    Returns future value of an annuity

Function GetAllSettings(AppName As String, Section As String)
    Member of VBA.Interaction
    Returns a list of key settings and their respective values from an application's Windows registry entry

Function GetAttr(PathName As String) As VbFileAttribute
    Member of VBA.FileSystem
    Returns the attributes of a file, directory, or folder 

Function GetObject([PathName], [Class])
    Member of VBA.Interaction
    Returns a reference to an ActiveX object from a file 

Function GetSetting(AppName As String, Section As String, Key As String, [Default]) As String
    Member of VBA.Interaction
    Returns a key setting value from an application's entry in the Windows registry


Function Hex(Number)
    Member of VBA.Conversion
    Returns a string representing the hexadecimal value of a number

Function Hex$(Number) As String
    Member of VBA.Conversion
    Returns a string representing the hexadecimal value of a number

Function Hour(Time)
    Member of VBA.DateTime
    Returns a whole number representing the hour of the day

Function IIf(Expression, TruePart, FalsePart)
    Member of VBA.Interaction
    Returns one of two parts, depending on the evaluation of an expression

Function IMEStatus() As VbIMEStatus
    Member of VBA.Information
    Returns the current IME mode of the system

Function InputBox(Prompt, [Title], [Default], [XPos], [YPos], [HelpFile], [Context]) As String
    Member of VBA.Interaction
    Displays a prompt in a dialog box and returns user input text

Function InStr([Start], [String1], [String2], [Compare As VbCompareMethod = vbBinaryCompare])
    Member of VBA.Strings
    Returns the position of the first occurrence of one string within another

Function InStrB([Start], [String1], [String2], [Compare As VbCompareMethod = vbBinaryCompare])
    Member of VBA.Strings
    Returns the byte position of the first occurrence of one string within another

Function InStrRev(StringCheck As String, StringMatch As String, [Start As Long = -1], [Compare As VbCompareMethod = vbBinaryCompare]) As Long
    Member of VBA.Strings
    Returns the position of the last occurrence of one string within another

Function Int(Number)
    Member of VBA.Conversion
    Returns the integer portion of a number

Function IPmt(Rate As Double, Per As Double, NPer As Double, PV As Double, [FV], [Due]) As Double
    Member of VBA.Financial
    Returns the interest payment for a given period of an annuity

Function IRR(ValueArray() As Double, [Guess]) As Double
    Member of VBA.Financial
    Returns the internal rate of return for a series of periodic cash flows


Function IsArray(VarName) As Boolean
    Member of VBA.Information
    Returns True if the variable is an array

Function IsDate(Expression) As Boolean
    Member of VBA.Information
    Returns True if an expression can be converted to a date

Function IsEmpty(Expression) As Boolean
    Member of VBA.Information
    Returns True if a variable has not been initialized

Function IsError(Expression) As Boolean
    Member of VBA.Information
    Returns True if an expression is an error value

Function IsMissing(ArgName) As Boolean
    Member of VBA.Information
    Returns True if an optional argument has not been passed

Function IsNull(Expression) As Boolean
    Member of VBA.Information
    Returns True if an expression contains no valid data


Function IsNumeric(Expression) As Boolean
    Member of VBA.Information
    Returns True if an expression can be evaluated as a number

Function IsObject(Expression) As Boolean
    Member of VBA.Information
    Returns True if an identifier represents an object variable

Function Join(SourceArray, [Delimiter]) As String
    Member of VBA.Strings
    Join array elements into a string

Sub Kill(PathName)
    Member of VBA.FileSystem
    Deletes files from a disk

Function LCase(String)
    Member of VBA.Strings
    Returns a string converted to lowercase

Function LCase$(String As String) As String
    Member of VBA.Strings
    Returns a string converted to lowercase


Function Left(String, Length As Long)
    Member of VBA.Strings
    Returns a specified number of characters from the left side of a string

Function Left$(String As String, Length As Long) As String
    Member of VBA.Strings
    Returns a specified number of characters from the left side of a string

Function LeftB(String, Length As Long)
    Member of VBA.Strings
    Returns a specified number of bytes from the left side of a string

Function LeftB$(String As String, Length As Long) As String
    Member of VBA.Strings
    Returns a specified number of bytes from the left side of a string

Function Len(Expression)
    Member of VBA.Strings
    Returns string length or bytes required to store a variable

Function LenB(Expression)
    Member of VBA.Strings
    Returns the bytes required to store a variable


Sub Load(object As object)
    Member of VB.Global
    Loads a form or control into memory.


Function LoadPicture([filename], [widthDesired As Long], [heightDesired As Long], [flags As LoadPictureConstants = Default]) As IPictureDisp
    Member of stdole.StdFunctions
    Loads a picture from a file


Function LoadPicture([FileName], [Size], [ColorDepth], [X], [Y]) As IPictureDisp
    Member of VB.Global
    Loads a graphic into a Form, PictureBox, or Image control.


Function LoadResData(id, type)
    Member of VB.Global
    Loads data of several possible types from a resource file (.RES) and returns a Byte array.

Function LoadResPicture(id, restype As Integer) As IPictureDisp
    Member of VB.Global
    Loads a bitmap, icon, or cursor from a resource (.RES) file and returns it to the appropriate control.

Function LoadResString(id As Long) As String
    Member of VB.Global
    Loads a string from a resource (.RES) file and returns it as a property of a control.


Function Loc(FileNumber As Integer) As Long
    Member of VBA.FileSystem
    Returns the current read/write position within an open file

Function LOF(FileNumber As Integer) As Long
    Member of VBA.FileSystem
    Returns the size (in bytes) of an open file

Function Log(Number As Double) As Double
    Member of VBA.Math
    Returns the natural logarithm of a number

Function LTrim(String)
    Member of VBA.Strings
    Returns a copy of a string without leading spaces

Function LTrim$(String As String) As String
    Member of VBA.Strings
    Returns a copy of a string without leading spaces

Function Mid(String, Start As Long, [Length])
    Member of VBA.Strings
    Returns specified number of characters from a string


Function Mid$(String As String, Start As Long, [Length]) As String
    Member of VBA.Strings
    Returns specified number of characters from a string

Function MidB(String, Start As Long, [Length])
    Member of VBA.Strings
    Returns the specified number of bytes from a string

Function MidB$(String As String, Start As Long, [Length]) As String
    Member of VBA.Strings
    Returns the specified number of bytes from a string

Function Minute(Time)
    Member of VBA.DateTime
    Returns a whole number representing the minute of the hour

Function MIRR(ValueArray() As Double, FinanceRate As Double, ReinvestRate As Double) As Double
    Member of VBA.Financial
    Returns the modified internal rate of return for a series of periodic cash flows

Sub MkDir(Path As String)
    Member of VBA.FileSystem
    Creates a new directory or folder


Function Month(Date)
    Member of VBA.DateTime
    Returns a whole number representing the month of the year


Function MonthName(Month As Long, [Abbreviate As Boolean = False]) As String
    Member of VBA.Strings
    Returns localized month name

Function MsgBox(Prompt, [Buttons As VbMsgBoxStyle = vbOKOnly], [Title], [HelpFile], [Context]) As VbMsgBoxResult
    Member of VBA.Interaction
    Displays a dialog box and returns the value of the user's selection

Function NPer(Rate As Double, Pmt As Double, PV As Double, [FV], [Due]) As Double
    Member of VBA.Financial
    Returns the number of periods for an annuity

Function NPV(Rate As Double, ValueArray() As Double) As Double
    Member of VBA.Financial
    Returns the net present value of an investment

Function Oct(Number)
    Member of VBA.Conversion
    Returns a string representing the octal value of a number


Function Oct$(Number) As String
    Member of VBA.Conversion
    Returns a string representing the octal value of a number

Function Partition(Number, Start, Stop, Interval)
    Member of VBA.Interaction
    Returns string indicating where a number occurs within a series of ranges

Function Pmt(Rate As Double, NPer As Double, PV As Double, [FV], [Due]) As Double
    Member of VBA.Financial
    Returns the payment for an annuity

Function PPmt(Rate As Double, Per As Double, NPer As Double, PV As Double, [FV], [Due]) As Double
    Member of VBA.Financial
    Returns the principal payment for a given period of an annuity

Function PV(Rate As Double, NPer As Double, Pmt As Double, [FV], [Due]) As Double
    Member of VBA.Financial
    Returns the present value of an annuity

Function QBColor(Color As Integer) As Long
    Member of VBA.Information
    Returns the RGB color code for a specified color number from a list of predefined standard colors


Sub Randomize([Number])
    Member of VBA.Math
    Initializes the random-number generator

Function Rate(NPer As Double, Pmt As Double, PV As Double, [FV], [Due], [Guess]) As Double
    Member of VBA.Financial
    Returns the interest rate per period for an annuity

Function Replace(Expression As String, Find As String, Replace As String, [Start As Long = 1], [Count As Long = -1], [Compare As VbCompareMethod = vbBinaryCompare]) As String
    Member of VBA.Strings
    Find and replace a substring within a string

Sub Reset()
    Member of VBA.FileSystem
    Closes all open disk files

Function RGB(Red As Integer, Green As Integer, Blue As Integer) As Long
    Member of VBA.Information
    Returns a whole number representing an RGB color value

Function Right(String, Length As Long)
    Member of VBA.Strings
    Returns a specified number of characters from the right side of a string


Function Right$(String As String, Length As Long) As String
    Member of VBA.Strings
    Returns a specified number of characters from the right side of a string

Function RightB(String, Length As Long)
    Member of VBA.Strings
    Returns the specified number of bytes from the right side of a string

Function RightB$(String As String, Length As Long) As String
    Member of VBA.Strings
    Returns the specified number of bytes from the right side of a string

Sub RmDir(Path As String)
    Member of VBA.FileSystem
    Removes an existing directory or folder

Function Rnd([Number]) As Single
    Member of VBA.Math
    Returns a random number

Function Round(Number, [NumDigitsAfterDecimal As Long])
    Member of VBA.Math
    Round to a given number of decimal places


Function RTrim(String)
    Member of VBA.Strings
    Returns a copy of a string without trailing spaces

Function RTrim$(String As String) As String
    Member of VBA.Strings
    Returns a copy of a string without trailing spaces

Sub SavePicture(Picture As IPictureDisp, FileName As String)
    Member of VB.Global
    Saves a graphic from a Form, PictureBox, or Image control to a file.

Sub SavePicture(Picture As IPictureDisp, filename As String)
    Member of stdole.StdFunctions
    Saves a picture to a file

Sub SaveSetting(AppName As String, Section As String, Key As String, Setting As String)
    Member of VBA.Interaction
    Saves a setting under the specified appname, section and key

Function Second(Time)
    Member of VBA.DateTime
    Returns a whole number representing the second of the minute


Function Seek(FileNumber As Integer) As Long
    Member of VBA.FileSystem
    Sets or returns the current read/write position within an open file

Sub SendKeys(String As String, [Wait])
    Member of VBA.Interaction
    Sends keystroke(s) to the active window

Sub SetAttr(PathName As String, Attributes As VbFileAttribute)
    Member of VBA.FileSystem
    Sets attribute information for a file

Function Sgn(Number)
    Member of VBA.Math
    Returns an integer indicating the sign of a number

Function Shell(PathName, [WindowStyle As VbAppWinStyle = vbMinimizedFocus]) As Double
    Member of VBA.Interaction
    Runs an executable program

Function Sin(Number As Double) As Double
    Member of VBA.Math
    Returns the sine of an angle


Function SLN(Cost As Double, Salvage As Double, Life As Double) As Double
    Member of VBA.Financial
    Returns the straight-line depreciation of an asset for a single period

Function Space(Number As Long)
    Member of VBA.Strings
    Returns a string consisting of the specified number of spaces

Function Space$(Number As Long) As String
    Member of VBA.Strings
    Returns a string consisting of the specified number of spaces

Function Split(Expression As String, [Delimiter], [Limit As Long = -1], [Compare As VbCompareMethod = vbBinaryCompare])
    Member of VBA.Strings
    Split a string into an array

Function Sqr(Number As Double) As Double
    Member of VBA.Math
    Returns the square root of a number

Function Str(Number)
    Member of VBA.Conversion
    Returns a string representation of a number


Function Str$(Number) As String
    Member of VBA.Conversion
    Returns a string representation of a number

Function StrComp(String1, String2, [Compare As VbCompareMethod = vbBinaryCompare])
    Member of VBA.Strings
    Returns the result of a string comparison

Function StrConv(String, Conversion As VbStrConv, [LocaleID As Long])
    Member of VBA.Strings
    Returns a converted string

Function String(Number As Long, Character)
    Member of VBA.Strings
    Returns a repeating character string of the length specified

Function String$(Number As Long, Character) As String
    Member of VBA.Strings
    Returns a repeating character string of the length specified

Function StrReverse(Expression As String) As String
    Member of VBA.Strings
    Reverse a string

Function Switch(ParamArray VarExpr() As Variant)
    Member of VBA.Interaction
    Returns the first value or expression in a list that is true

Function SYD(Cost As Double, Salvage As Double, Life As Double, Period As Double) As Double
    Member of VBA.Financial
    Returns the sum-of-years' digits depreciation on an asset

Function Tan(Number As Double) As Double
    Member of VBA.Math
    Returns the tangent of an angle

Function TimeSerial(Hour As Integer, Minute As Integer, Second As Integer)
    Member of VBA.DateTime
    Returns the serial representation for a specific hour, minute, and second

Function TimeValue(Time As String)
    Member of VBA.DateTime
    Returns a time

Function Trim(String)
    Member of VBA.Strings
    Returns a copy of a string without leading and trailing spaces


Function Trim$(String As String) As String
    Member of VBA.Strings
    Returns a copy of a string without leading and trailing spaces

Function TypeName(VarName) As String
    Member of VBA.Information
    Returns a string that provides information about a variable

Function UCase(String)
    Member of VBA.Strings
    Returns the specified string, converted to uppercase

Function UCase$(String As String) As String
    Member of VBA.Strings
    Returns the specified string, converted to uppercase

Sub Unload(object As object)
    Member of VB.Global
    Unloads a form or control from memory.

Function Val(String As String) As Double
    Member of VBA.Conversion
    Returns the numbers contained in a string

Function VarType(VarName) As VbVarType
    Member of VBA.Information
    Returns a value indicating the subtype of a variable

Function Weekday(Date, [FirstDayOfWeek As VbDayOfWeek = vbSunday])
    Member of VBA.DateTime
    Returns a whole number representing the day of the week

Function WeekdayName(Weekday As Long, [Abbreviate As Boolean = False], [FirstDayOfWeek As VbDayOfWeek = vbUseSystemDayOfWeek]) As String
    Member of VBA.Strings
    Returns localized weekday name

Function Year(Date)
    Member of VBA.DateTime
    Returns a whole number representing the year

1 komentar:

adithya irawan mengatakan...

ijin sedot gan...