Formatting an Excel from Access vba.

C

CyndyG

I have an Excel spreadsheet that is created each time an Access form is
executed.

wks.cells(j, .Fields("MonthNumber") * 2 + 1) = .Fields("Total")
.MoveNext

Could some one tell what I code to format the Total field in an accounting
format . When I ran an Excel Macro this is the code I received:
Range("K3").Select
Selection.NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($*
""-""??_);_(@_)"
which is what I want,but don't know how to get it to be accepted in Access.

I am getting errors such as method not found or invalid format.
 
K

Klatuu

Cyndy,

I have had the same problem. It doesn't make sense to me that passing an
Excel format from Access should object to Excel formatting; however, try this
and see if it gives you the result you need:

Selection.NumberFormat = "$#,##0.00);($#,##0.00);"-""
 
C

CyndyG

THanks,but still does not work,

Klatuu said:
Cyndy,

I have had the same problem. It doesn't make sense to me that passing an
Excel format from Access should object to Excel formatting; however, try this
and see if it gives you the result you need:

Selection.NumberFormat = "$#,##0.00);($#,##0.00);"-""
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top