Vba And Excel Object Model Quick Reference

VBA FUNCTION CONSTANTS AND CHARACTERS.

Format Function Characters

DATE/TIME CHARACTERS

DISPLAYS

Day with no leading zero.

ddd

Three-letter abbreviation of day (Sun. - Sat.).

dddd

Full day name (Sunday).

ddddd

Complete date using short date format.

dddddd

Complete date using long date format.

Day of week as number (1 for Sunday).

ww

Week of year as number.

Month with no leading zero.

mmm

Three letter abbreviation of month (Jan.-Dec.).

mmmm

Complete month name.

q

Quarter of year.

y

Day of year as number.

yy

Year as 2-digit number.

yyyy

Year as 4-digit number.

h

Hour with no leading zero.

n

Minutes with no leading zero.

Seconds with no leading zero.

ttttt

Complete time using system time format.

Date as dddddd and time as ttttt.

Format Function Predefined Formats

FORMAT

DESCRIPTION

General Date

Uses general date format.

Long Date

Uses system-defined long date, such as Tuesday, August 7, 2001.

Medium Date

Uses the medium date format, such as 07-Aug-01.

Short Date

Uses system-defined short date, such as 8/7/2001.

Long Time

Uses system-defined long time, such as 5:45:30 P.M.

Medium Time

Uses the medium time format, such as 05:45 P.M.

VBA FUNCTION CONSTANTS AND CHARACTERS-

Format Function Predefined Formats (Continued)

FORMAT

DESCRIPTION

Short Time

Uses the short time format, such as 17:45.

General Number

Uses the general number format.

Currency

Places the appropriate currency symbol in front of the number.

Fixed

Uses a fixed decimal format.

Standard

Uses standard formatting.

Percent

Converts the expression to a percentage.

Scientific

Displays the expression using scientific notation.

Yes/No

Converts the expression to a Yes or No value.

True/False

Converts the expression to a True or False value.

On/Off

Converts the expression to an On or Off value.

EXCEL OBJECT MODEL CONSTANTS

XlColumnDataType Constants

CONSTANT

VALUE

DESCRIPTION

xlDMYFormat

4

DMY format date

xlDYMFormat

7

DYM format date

xlEMDFormat

10

EMD format date

xlGeneralFormat

1

General format

xlMDYFormat

3

MDY format date

xlMYDFormat

6

MYD format date

xlSkipColumn

9

Skip Column

xlTextFormat

2

Text format

xlYDMFormat

8

YDM format date

xlYMDFormat

5

YMD format date

XlFileFormat Constants

CONSTANT

VALUE

DESCRIPTION

xlAddIn

18

Excel add-in.

xlCSV

6

Comma-separated values format.

xlCSVMac

22

Macintosh comma-separated values format.

I

1

0 0

Post a comment