The Excel 2000 Visual Basic for Applications (VBA) Help topic for the
Style object contains the following information:
Using the Style Object
Use the Style property to return the Style object used with a Range object. The following example applies the Percent style to cells A1:A10 on Sheet1.
Worksheets("sheet1").Range("a1:a10").Style.Name = "percent"
The code in the preceding documentation is incorrect. The
Name property of the
Style object is read-only. Therefore, the code causes the following error message to appear:
Run-time error '450':
Wrong number of arguments or invalid property assignment
To apply the Percent style to A1:A10 on Sheet1 as the sample intends, use the following code instead:
Worksheets("sheet1").Range("a1:a10").Style = "percent"