ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Number Format (https://www.excelbanter.com/excel-programming/356182-number-format.html)

Bill[_35_]

Number Format
 
Hello,
I have the following that works in Excel 2003, but not in Excel 2000. I
am trying to apply a number format to an average of a range (called DB)

Dim VF as string, DB as database, DAvg
VF = DB(1,1).numberformat
DBavg = format(application.average(DB),VF)

When the number format is General, the value I get for DBAvg is
"Ge5enral". Why is that happening and how do I get around this?

Thanks.





*** Sent via Developersdex http://www.developersdex.com ***

Ron Rosenfeld

Number Format
 
On Thu, 16 Mar 2006 03:39:58 -0800, Bill wrote:

Hello,
I have the following that works in Excel 2003, but not in Excel 2000. I
am trying to apply a number format to an average of a range (called DB)

Dim VF as string, DB as database, DAvg
VF = DB(1,1).numberformat
DBavg = format(application.average(DB),VF)

When the number format is General, the value I get for DBAvg is
"Ge5enral". Why is that happening and how do I get around this?

Thanks.


I don't know about Excel 2003, as I only have 2002, but in 2002, numberformat
is not a property of the Database object.


--ron

Bill[_35_]

Number Format
 
What would you use to find the number format in Excel 2002 then?



*** Sent via Developersdex http://www.developersdex.com ***

Ron Rosenfeld

Number Format
 
On Thu, 16 Mar 2006 11:56:17 -0800, Bill wrote:

What would you use to find the number format in Excel 2002 then?



*** Sent via Developersdex http://www.developersdex.com ***


When I've used the NumberFormat property in Excel 2002, I've used it as a
property of the Range object.

I really don't have any experience with the Database collection or object. But
in VBA6, there is no NumberFormat property for that object.


--ron


All times are GMT +1. The time now is 10:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com