Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel cell formating

Status
Not open for further replies.

kbestle

Technical User
Mar 9, 2003
67
US
I am sending data from an Access crosstab query to a mail receipient as an Excel spreadsheet. There are 5 columns in the spreadsheet that provide the person fields to enter a price. These cells by default have a format of General which does not work for entering currency values. Is there a way to force the cell format in Excel to be number with 4 decimal places as it is converted to Excel format? I don't want to ask the mail receipient to have to make this change.

Thanks
Kent
 
Hi,

Turn on your macro recorder (Tools/Macro...)

Record the process of setting the column format to whatever

Turn OFF the macro recorder.

Put tht macro name in the Workbook_Open event.

So if you named your macro FormatNumbers
then in the ThisWorkbook Object in the VB Editor (alt+F11)
Code:
Private Sub Workbook_Open()
  FormatNumbers
End Sub
and it'll run every time the workbook is opened.


Skip,

[glasses] [red]Be advised:[/red] When transmitting sheet music...
If it ain't baroque, don't fax it! [tongue]
 
If oyu don't want to use macros:

On tools...options... edit tab you have an option
called "fixed decimals". It won't help you with the currency format, though.

// Patrik
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top