Results 1 to 4 of 4
  1. #1
    msaccessdev is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2014
    Posts
    13

    Excel format "Text to column" using ACCESS VBA

    Hi there,

    I am trying the change the excel cell value format to number from general after exporting data from access query record set to excel. but the format is not changing and causing me problem of not updating the formulas in the excel file.

    i tried the "eWS.Application.Range("L10:L" & rowcnt).NumberFormat = "_(* #,##0_);_(* (#,##0);_(* " - "??_);_(@_)"" this option but nothing is working here.

    i tried to change the format directly in the excel and exporting the data form access ... but the format is getting changed since the export is done.

    please help.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I have never tried using the NumberFormat property from Access.

    Have you tried, first, to set the type by using
    ...NumberFormat = "Number"

    and then find a way to limit the number of decimals. And then manage how the commas, etc. are displayed???
    ...NumberFormat = "_(* #,##0_);_(* (#,##0);_(* " - "??_);_(@_)"

  3. #3
    msaccessdev is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2014
    Posts
    13
    yeah, I tried almost all the possibilities. like

    NumberFormat = "General"
    NumberFormat = "Accounting"
    NumberFormat = "Number"
    NumberFormat = "$#,##0.00"
    NumberFormat = "#,##0.00"

    and nothing seems working. If i do it manually in the Excel file through the option of "TextToColumn" Delimit ... the format is changing. but if i do the same way through MS Access code ... its not updating.

    thanks

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Perhaps posting the code you are using will shed some light. One thing to keep in mind is that VBA for Access is not VBA for Excel. Methods and properties available in Excel may not be available in Access and vise versa.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Column sum works in "Detail" but not "Footer"
    By Doodlebug2000 in forum Reports
    Replies: 1
    Last Post: 12-10-2012, 03:20 PM
  2. Replies: 2
    Last Post: 11-14-2012, 04:47 PM
  3. Export "Query or Report" to a "Delimited Text File"
    By hawzmolly in forum Import/Export Data
    Replies: 3
    Last Post: 08-31-2012, 08:00 AM
  4. Replies: 1
    Last Post: 04-25-2011, 12:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums