Formatting an Excel from Access vba.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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);"-""
 
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);"-""
 
Back
Top