LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default formatting ms access to ms excel report

Hi Patrick Molloy,
Thanks for your reply. Actually, a run-time error 13: Type Mismatch is
coming,
which is not letting the format to be completed successfully on columns B &
C. When its applied on the date field column A, its formatting the data
successfully over there. I am calculating my fields from an sql joint query
which is using the column alias names, and so the number columns are
converted into text, when data is transferred into Excel, on which the code
is not being applied successfully. A green arrow mark is coming on the
column, on which message is coming to change the data from text to number.
Kindly guide how to remove the error and format the data successfully in the
B & C Columns. I'd much appreciate your guidance.

"Patrick Molloy" wrote:

you need to give us more information regarding the error message.
it is unlikely that this line of code
ws.Range("A1").CurrentRegion
will raise any errors

If you want just those two columns formatted then
ws.Range("B:C").NumberFormat = "0.00;(0.00)"

should work fine.
if cells contain TEXT, then of course, they don't get formatted, but this is
not an error.
if not, then you need to give us more details of the data or errors.




"Imran Ghani" wrote in message
...
Hi,
Thanks for your helping notes.
I have not yet been able to apply the command to the desired columns, as
there is an error message of data type mismatch. Can you please guide me
about the command which can convert data back to number from other
formats.
Regards,
Imran.

"Patrick Molloy" wrote:

change

to

ws.Range("B:C").NumberFormat = "0.00;(0.00)"

"Imran Ghani" wrote in message
...
Hi Patrick Molloy,
Thanks for your guidance. I have got my number data in column B and C.
Please guide me about how to give the above range in the following
ws.Range("A1").CurrentRegion
Regards,
Imran.


"Patrick Molloy" wrote:

when data is copied to excel from Access, they're just numbers, so
there
is
no formatting. you should open excel and use code to format the data
you can do this with Access VBA too

Sub tester()

Dim xl As Object
Dim wb As Object
Dim ws As Object

Set xl = CreateObject("Excel.Application")
''xl.Visible = True 'not required - use for testing

Set wb = xl.Workbooks.Open("C:\temp\abc.xls")
Set ws = wb.ActiveSheet

ws.Range("A1").CurrentRegion.NumberFormat = "0.00;(0.00)"

'cleanup - must have!!
Set ws = Nothing
wb.Close False
Set wb = Nothing
xl.Quit
Set xl = Nothing

End Sub


"Imran Ghani" wrote in message
...
Hi! I am exporting my report from ms access to ms excel with the
help
of
command:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97,
"qryunionpayinv", "D:\My Reports\banking.xls", True
I am not having the exported data in the desired currency format of
"000.00", nd a small green sign is also coming with the data. Kindly
guide
me
about how to export the data with the desired format, and of course,
w/o
the
green sign, as well, I also want to have the total of the number
field
at
the
end of the records.
Kindly guide me about how to achieve my task successfully in excel.
Regards,
Imran.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting an Access report into Excel Stanley Excel Discussion (Misc queries) 2 November 12th 08 04:26 PM
Analyzing Access Report with Excel DoveArrow Excel Discussion (Misc queries) 4 May 28th 08 10:09 PM
MS OfficeLinks (from Access report to Excel) ES Excel Discussion (Misc queries) 2 January 9th 07 07:24 PM
Printing an Access Report from Excel Noemi Excel Programming 1 June 1st 06 08:30 AM
Create Access like report in Excel. J-Sherm-Dwyer Excel Programming 0 February 17th 05 08:03 PM


All times are GMT +1. The time now is 03:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"