Microsoft Excel 2008 For Mac Function Reference

  
-->

Returns a String representing the name of a file, directory, or folder that matches a specified pattern or file attribute, or the volume label of a drive.

Syntax

Oct 14, 2008  Microsoft Office 2008 for Mac 12.1.3 Update. Office 2008, Office 2008 Home and Student Edition, Office 2008 Special Media Edition, Word 2008, Excel 2008, PowerPoint 2008, Entourage 2008. System Requirements Supported Operating System. Print this page if you want to use it as a reference when you are offline. Excel for Mac Discover contextual tools You can display additional ribbon commands by selecting specific items in your workbook. For example, select a chart to reveal the Chart Design and Format ribbon tabs, or select a sparkline to reveal the Design tab. Insert functions, build formulas. Microsoft Office 2008 for Mac is a version of the Microsoft Office productivity suite for Mac OS X. It supersedes Office 2004 for Mac (which did not have Intel native code) and is the Mac OS X equivalent of Office 2007. Office 2008 was developed by Microsoft's Macintosh Business Unit and released on January 15, 2008.

Dir [ (pathname, [ attributes ] ) ]


The Dir function syntax has these parts:

PartDescription
pathnameOptional. String expression that specifies a file name; may include directory or folder, and drive. A zero-length string (') is returned if pathname is not found.
attributesOptional. Constant or numeric expression, whose sum specifies file attributes. If omitted, returns files that match pathname but have no attributes.

Settings

The attributesargument settings are:

ConstantValueDescription
vbNormal0(Default) Specifies files with no attributes.
vbReadOnly1Specifies read-only files in addition to files with no attributes.
vbHidden2Specifies hidden files in addition to files with no attributes.
vbSystem4Specifies system files in addition to files with no attributes. Not available on the Macintosh.
vbVolume8Specifies volume label; if any other attribute is specified, vbVolume is ignored. Not available on the Macintosh.
vbDirectory16Specifies directories or folders in addition to files with no attributes.
vbAlias64Specified file name is an alias. Available only on the Macintosh.

Note

These constants are specified by Visual Basic for Applications and can be used anywhere in your code in place of the actual values.

Remarks

In Microsoft Windows, Dir supports the use of multiple character (*) and single character (?) wildcards to specify multiple files. On the Macintosh, these characters are treated as valid file name characters and can't be used as wildcards to specify multiple files.

Because the Macintosh doesn't support the wildcards, use the file type to identify groups of files. You can use the MacID function to specify file type instead of using the file names. For example, the following statement returns the name of the first TEXT file in the current folder:

To iterate over all files in a folder, specify an empty string:

If you use the MacID function with Dir in Microsoft Windows, an error occurs.

Any attribute value greater than 256 is considered a MacID value.

You must specify pathname the first time you call the Dir function, or an error occurs. If you also specify file attributes, pathname must be included.

Dir returns the first file name that matches pathname. To get any additional file names that match pathname, call Dir again with no arguments. When no more file names match, Dir returns a zero-length string ('). After a zero-length string is returned, you must specify pathname in subsequent calls, or an error occurs.

You can change to a new pathname without retrieving all of the file names that match the current pathname. However, you can't call the Dir function recursively. Calling Dir with the vbDirectory attribute does not continually return subdirectories.

With Excel for Mac 2016, the initial Dir function call will succeed. Subsequent calls to iterate through the specified directory will cause an error, however. This is a known bug unfortunately.

Tip

Microsoft Excel 2008 For Mac Function Reference Free

Reference

Because file names are retrieved in no particular order, you may want to store returned file names in an array, and then sort the array.

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.

This article describes the formula syntax and usage of the ERROR.TYPE function in Microsoft Excel.

Description

Returns a number corresponding to one of the error values in Microsoft Excel or returns the #N/A error if no error exists. You can use ERROR.TYPE in an IF function to test for an error value and return a text string, such as a message, instead of the error value.

Syntax

ERROR.TYPE(error_val)

Microsoft Excel 2008 For Mac Function Reference Word

The ERROR.TYPE function syntax has the following arguments:

  • Error_val Required. The error value whose identifying number you want to find. Although error_val can be the actual error value, it will usually be a reference to a cell containing a formula that you want to test.

If error_val is

ERROR.TYPE returns

#NULL!

1

#DIV/0!

2

#VALUE!

3

#REF!

4

#NAME?

5

#NUM!

6

#N/A

7

#GETTING_DATA

8

Anything else

#N/A

Example

Microsoft Excel 2008 For Mac

Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.

Microsoft Excel 2008 For Mac Function Reference Pdf

Data

#NULL!

#DIV/0!

Formula

Description

An Office 365 subscription provides always up-to-date versions of Office apps and access to additional premium. Should I download Office from the Mac App Store?If you own the older perpetual release of Office, you can download the new version of the apps from the Mac App Store, and purchase a new Office 365 subscription using the in-app purchase option. The apps available in the Mac App Store are not compatible with Office 2019 licenses.I currently own Office 2016 for Mac and want to upgrade my version of Office. Activate microsoft office 365 on mac.

Result

=ERROR.TYPE(A2)

Number of the #NULL! Error(1).

1

=IF(ERROR.TYPE(A3)<3,CHOOSE(ERROR.TYPE(A3),'Ranges do not intersect','The divisor is zero'))

Checks cell A3 to see whether the cell contains either the #NULL! error value or the #DIV/0! error value. If it does, then the number for the error value is used in the CHOOSE worksheet function to display one of two messages; otherwise, the #N/A error value is returned.

The divisor is zero