Microsoft KB Archive/299490

= Data validation list entries all on one line in Excel =

Article ID: 299490

Article Last Modified on 1/31/2007

-

APPLIES TO


 * Microsoft Office Excel 2007
 * Microsoft Office Excel 2003
 * Microsoft Excel 2002 Standard Edition
 * Microsoft Excel 2000 Standard Edition

-



This article was previously published under Q299490



SYMPTOMS
When you run a Microsoft Excel macro or other programming code that sets data validation rules for a cell as a list of valid entries, all of the items in the data validation list on the cell appear on one line.



CAUSE
This behavior occurs when the following conditions are true:
 * The List Separator setting (under Regional Options in Control Panel) is something other than a Comma . For example, if your locale setting is Germany, your list separator is a semicolon.
 * The macro for data validation uses that list separator to specify the valid cell entries.
 * The macro code specifies the list explicitly, instead of pointing to a cell range where the valid entries are listed.



WORKAROUND
When you create a macro to specify a specific list of valid entries, always use a comma as your list separator.



MORE INFORMATION
In Excel, Microsoft Visual Basic for Applications always uses the comma as the list separator. This allows you to run a macro on computers that have different locale settings, without having to edit your code.

When you run a macro that uses a list separator to change a setting, the macro converts the comma to the local regional list separator. For example, this occurs if the macro creates a data validation list, or enters a formula in a cell by using the Range.Formula(number1,number2) command.

