Class Vba


  • public class Vba
    extends Object
    Implementations of functions in the Visual Basic for Applications (VBA) specification.

    The functions are defined in MSDN .

    Since:
    Dec 31, 2007
    Author:
    jhyde
    • Constructor Detail

      • Vba

        public Vba()
    • Method Detail

      • cBool

        public static boolean cBool​(Object expression)
      • cByte

        public static byte cByte​(Object expression)
      • cDate

        public static Date cDate​(Object expression)
      • cDbl

        public static double cDbl​(Object expression)
      • cInt

        public static int cInt​(Object expression)
      • fix

        public static int fix​(Object number)
      • int_

        public static int int_​(Object number)
      • val

        public static double val​(String string)
      • dateAdd

        public static Date dateAdd​(String intervalName,
                                   double number,
                                   Date date)
      • dateDiff

        public static long dateDiff​(String interval,
                                    Date date1,
                                    Date date2)
      • dateDiff

        public static long dateDiff​(String interval,
                                    Date date1,
                                    Date date2,
                                    int firstDayOfWeek)
      • dateDiff

        public static long dateDiff​(String interval,
                                    Date date1,
                                    Date date2,
                                    int firstDayOfWeek,
                                    int firstWeekOfYear)
      • datePart

        public static int datePart​(String interval,
                                   Date date)
      • datePart

        public static int datePart​(String interval,
                                   Date date,
                                   int firstDayOfWeek)
      • datePart

        public static int datePart​(String interval,
                                   Date date,
                                   int firstDayOfWeek,
                                   int firstWeekOfYear)
      • date

        public static Date date()
      • dateSerial

        public static Date dateSerial​(int year,
                                      int month,
                                      int day)
      • dateValue

        public static Date dateValue​(Date date)
      • day

        public static int day​(Date date)
      • hour

        public static int hour​(Date time)
      • minute

        public static int minute​(Date time)
      • month

        public static int month​(Date date)
      • now

        public static Date now()
      • second

        public static int second​(Date time)
      • time

        public static Date time()
      • timeSerial

        public static Date timeSerial​(int hour,
                                      int minute,
                                      int second)
      • timeValue

        public static Date timeValue​(Date time)
      • timer

        public static float timer()
      • weekday

        public static int weekday​(Date date)
      • weekday

        public static int weekday​(Date date,
                                  int firstDayOfWeek)
      • year

        public static int year​(Date date)
      • dDB

        public static double dDB​(double cost,
                                 double salvage,
                                 double life,
                                 double period)
      • dDB

        public static double dDB​(double cost,
                                 double salvage,
                                 double life,
                                 double period,
                                 double factor)
      • fV

        public static double fV​(double rate,
                                double nPer,
                                double pmt)
      • fV

        public static double fV​(double rate,
                                double nPer,
                                double pmt,
                                double pv)
      • fV

        public static double fV​(double rate,
                                double nPer,
                                double pmt,
                                double pv,
                                boolean type)
      • iPmt

        public static double iPmt​(double rate,
                                  double per,
                                  double nPer,
                                  double PV)
      • iPmt

        public static double iPmt​(double rate,
                                  double per,
                                  double nPer,
                                  double PV,
                                  double fv)
      • iPmt

        public static double iPmt​(double rate,
                                  double per,
                                  double nPer,
                                  double PV,
                                  double fv,
                                  boolean due)
      • IRR

        public static double IRR​(double[] valueArray)
      • IRR

        public static double IRR​(double[] valueArray,
                                 double guess)
      • MIRR

        public static double MIRR​(double[] valueArray,
                                  double financeRate,
                                  double reinvestRate)
      • nPer

        public static double nPer​(double rate,
                                  double pmt,
                                  double pv,
                                  double fv,
                                  boolean due)
      • nPV

        public static double nPV​(double r,
                                 double[] cfs)
      • pPmt

        public static double pPmt​(double rate,
                                  double per,
                                  double nPer,
                                  double PV)
      • pPmt

        public static double pPmt​(double rate,
                                  double per,
                                  double nPer,
                                  double PV,
                                  double fv)
      • pPmt

        public static double pPmt​(double rate,
                                  double per,
                                  double nPer,
                                  double PV,
                                  double fv,
                                  boolean due)
      • pmt

        public static double pmt​(double rate,
                                 double nPer,
                                 double pv,
                                 double fv,
                                 boolean due)
      • pV

        public static double pV​(double rate,
                                double nper,
                                double pmt,
                                double fv,
                                boolean due)
      • rate

        public static double rate​(double nPer,
                                  double pmt,
                                  double PV)
      • rate

        public static double rate​(double nPer,
                                  double pmt,
                                  double PV,
                                  double fv)
      • rate

        public static double rate​(double nPer,
                                  double pmt,
                                  double PV,
                                  double fv,
                                  boolean type)
      • rate

        public static double rate​(double nPer,
                                  double pmt,
                                  double PV,
                                  double fv,
                                  boolean due,
                                  double guess)
      • sLN

        public static double sLN​(double cost,
                                 double salvage,
                                 double life)
      • sYD

        public static double sYD​(double cost,
                                 double salvage,
                                 double life,
                                 double period)
      • isArray

        public boolean isArray​(Object varName)
      • isDate

        public static boolean isDate​(Object expression)
      • isError

        public boolean isError​(Object expression)
      • isMissing

        public boolean isMissing​(Object argName)
      • isNull

        public boolean isNull​(Object expression)
      • isNumeric

        public boolean isNumeric​(Object expression)
      • isObject

        public boolean isObject​(Object expression)
      • typeName

        public static String typeName​(Object varName)
      • abs

        public static double abs​(double number)
      • atn

        public static double atn​(double number)
      • cos

        public static double cos​(double number)
      • exp

        public static double exp​(double number)
      • log

        public static double log​(double number)
      • round

        public static double round​(double number)
      • round

        public static double round​(double number,
                                   int numDigitsAfterDecimal)
      • sgn

        public static int sgn​(double number)
      • sin

        public static double sin​(double number)
      • sqr

        public static double sqr​(double number)
      • tan

        public static double tan​(double number)
      • asc

        public static int asc​(String string)
      • ascB

        public static int ascB​(String string)
      • ascW

        public static int ascW​(String string)
      • chr

        public static String chr​(int charCode)
      • chrB

        public static String chrB​(int charCode)
      • chrW

        public static String chrW​(int charCode)
      • formatCurrency

        public static String formatCurrency​(Object expression)
      • formatCurrency

        public static String formatCurrency​(Object expression,
                                            int numDigitsAfterDecimal)
      • formatCurrency

        public static String formatCurrency​(Object expression,
                                            int numDigitsAfterDecimal,
                                            int includeLeadingDigit)
      • formatCurrency

        public static String formatCurrency​(Object expression,
                                            int numDigitsAfterDecimal,
                                            int includeLeadingDigit,
                                            int useParensForNegativeNumbers)
      • formatCurrency

        public static String formatCurrency​(Object expression,
                                            int numDigitsAfterDecimal,
                                            int includeLeadingDigit,
                                            int useParensForNegativeNumbers,
                                            int groupDigits)
      • formatDateTime

        public static String formatDateTime​(Date date)
      • formatDateTime

        public static String formatDateTime​(Date date,
                                            int namedFormat)
      • formatNumber

        public static String formatNumber​(Object expression)
      • formatNumber

        public static String formatNumber​(Object expression,
                                          int numDigitsAfterDecimal)
      • formatNumber

        public static String formatNumber​(Object expression,
                                          int numDigitsAfterDecimal,
                                          int includeLeadingDigit)
      • formatNumber

        public static String formatNumber​(Object expression,
                                          int numDigitsAfterDecimal,
                                          int includeLeadingDigit,
                                          int useParensForNegativeNumbers)
      • formatNumber

        public static String formatNumber​(Object expression,
                                          int numDigitsAfterDecimal,
                                          int includeLeadingDigit,
                                          int useParensForNegativeNumbers,
                                          int groupDigits)
      • formatPercent

        public static String formatPercent​(Object expression)
      • formatPercent

        public static String formatPercent​(Object expression,
                                           int numDigitsAfterDecimal)
      • formatPercent

        public static String formatPercent​(Object expression,
                                           int numDigitsAfterDecimal,
                                           int includeLeadingDigit)
      • formatPercent

        public static String formatPercent​(Object expression,
                                           int numDigitsAfterDecimal,
                                           int includeLeadingDigit,
                                           int useParensForNegativeNumbers)
      • formatPercent

        public static String formatPercent​(Object expression,
                                           int numDigitsAfterDecimal,
                                           int includeLeadingDigit,
                                           int useParensForNegativeNumbers,
                                           int groupDigits)
      • inStr

        public static int inStr​(String stringCheck,
                                String stringMatch)
      • inStr

        public static int inStr​(int start,
                                String stringCheck,
                                String stringMatch)
      • inStr

        public static int inStr​(int start,
                                String stringCheck,
                                String stringMatch,
                                int compare)
      • inStrRev

        public static int inStrRev​(String stringCheck,
                                   String stringMatch)
      • inStrRev

        public static int inStrRev​(String stringCheck,
                                   String stringMatch,
                                   int start)
      • inStrRev

        public static int inStrRev​(String stringCheck,
                                   String stringMatch,
                                   int start,
                                   int compare)
      • left

        public static String left​(String string,
                                  int length)
      • mid

        public static String mid​(String value,
                                 int beginIndex)
      • mid

        public static String mid​(String value,
                                 int beginIndex,
                                 int length)
      • monthName

        public static String monthName​(int month,
                                       boolean abbreviate)
      • replace

        public static String replace​(String expression,
                                     String find,
                                     String replace,
                                     int start,
                                     int count,
                                     int compare)
      • right

        public static String right​(String string,
                                   int length)
      • space

        public static String space​(int number)
      • strComp

        public static int strComp​(String string1,
                                  String string2)
      • strComp

        public static int strComp​(String string1,
                                  String string2,
                                  int compare)
      • strReverse

        public static String strReverse​(String expression)
      • string

        public static String string​(int number,
                                    char character)
      • weekdayName

        public static String weekdayName​(int weekday,
                                         boolean abbreviate,
                                         int firstDayOfWeek)