Eljefegeneo
Still trying to learn
- Local time
- Today, 15:01
- Joined
- Jan 10, 2011
- Messages
- 902
I am using a modified version of code to open an excel sheet for viewing. The problem is that I need it be auto fit and text wrapped. The code is a modified version of https://btabdevelopment.com/export-a-forms-recordset-to-excel/
All is well except that three number columns are now only one decimal place instead of two. I have tried almost everything, formatting the query to use Round([FieldName],2) etc. to no avail. When I use the Format([FieldName], 2, "Fixed") the columns are in text form.
As of now I can send the query to file as an Excel sheet with the correct formatting and open it, but it is not auto fixed or auto wrap. Or I can send it to file, open it and have to format the three columns as numbers and auto fit the worksheet.
Is there any way of modifying the code to say something like
All is well except that three number columns are now only one decimal place instead of two. I have tried almost everything, formatting the query to use Round([FieldName],2) etc. to no avail. When I use the Format([FieldName], 2, "Fixed") the columns are in text form.
As of now I can send the query to file as an Excel sheet with the correct formatting and open it, but it is not auto fixed or auto wrap. Or I can send it to file, open it and have to format the three columns as numbers and auto fit the worksheet.
Is there any way of modifying the code to say something like
Code:
With ApXL.Selection.Number