Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent scientific formatting when creating excel sheet from vbscr
Hi,
I'm trying to create an excel sheet using html <table tags from vbscript. One of the columns contains numbers 14 digits long. On opening the file created it shows the numbers as 2.3024E+13. I tried adding an apostrophe ( ' ) before the number. But sadly the apostrophe also shows on the excel sheet. How can I prevent the number to convert to scientific format and display all 14 digits either as number or text? Thanks in advance, programinfinity |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent scientific formatting when creating excel sheet from vbscr
Format the column to Text before placing the text
Range("A:A").NumberFormat = "@" If this post helps click Yes --------------- Jacob Skaria "programinfinity" wrote: Hi, I'm trying to create an excel sheet using html <table tags from vbscript. One of the columns contains numbers 14 digits long. On opening the file created it shows the numbers as 2.3024E+13. I tried adding an apostrophe ( ' ) before the number. But sadly the apostrophe also shows on the excel sheet. How can I prevent the number to convert to scientific format and display all 14 digits either as number or text? Thanks in advance, programinfinity |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent scientific formatting when creating excel sheet from v
thanks for the reply,
the excel sheet is also newly created by the vbscript so i cannot format the column before. is there something I can set in the column properties while writing out the excel file the same way I can set widths - like using 'mso-width-source:userset;mso-width-alt:3754;width:105pt'? i need to email out the excel sheet from the script so I can't edit and change the format either. - programinfinity "Jacob Skaria" wrote: Format the column to Text before placing the text Range("A:A").NumberFormat = "@" If this post helps click Yes --------------- Jacob Skaria "programinfinity" wrote: Hi, I'm trying to create an excel sheet using html <table tags from vbscript. One of the columns contains numbers 14 digits long. On opening the file created it shows the numbers as 2.3024E+13. I tried adding an apostrophe ( ' ) before the number. But sadly the apostrophe also shows on the excel sheet. How can I prevent the number to convert to scientific format and display all 14 digits either as number or text? Thanks in advance, programinfinity |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent scientific formatting when creating excel sheet from v
Using vbscript...
Set xlApp = CreateObject("Excel.Application") Set xlwbk = xlApp.Workbooks.Add 'If you need to format the entire workbook xlwbk.Sheets(1).Cells.NumberFormat = "@" 'If you need to format Col A xlwbk.Sheets(1).Range("A:A").NumberFormat = "@" If this post helps click Yes --------------- Jacob Skaria "programinfinity" wrote: thanks for the reply, the excel sheet is also newly created by the vbscript so i cannot format the column before. is there something I can set in the column properties while writing out the excel file the same way I can set widths - like using 'mso-width-source:userset;mso-width-alt:3754;width:105pt'? i need to email out the excel sheet from the script so I can't edit and change the format either. - programinfinity "Jacob Skaria" wrote: Format the column to Text before placing the text Range("A:A").NumberFormat = "@" If this post helps click Yes --------------- Jacob Skaria "programinfinity" wrote: Hi, I'm trying to create an excel sheet using html <table tags from vbscript. One of the columns contains numbers 14 digits long. On opening the file created it shows the numbers as 2.3024E+13. I tried adding an apostrophe ( ' ) before the number. But sadly the apostrophe also shows on the excel sheet. How can I prevent the number to convert to scientific format and display all 14 digits either as number or text? Thanks in advance, programinfinity |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent scientific formatting when creating excel sheet from v
<table
<tr <td style='mso-number-format:\@;'12345678912345667</td </tr </table Tim "programinfinity" wrote in message ... thanks for the reply, the excel sheet is also newly created by the vbscript so i cannot format the column before. is there something I can set in the column properties while writing out the excel file the same way I can set widths - like using 'mso-width-source:userset;mso-width-alt:3754;width:105pt'? i need to email out the excel sheet from the script so I can't edit and change the format either. - programinfinity "Jacob Skaria" wrote: Format the column to Text before placing the text Range("A:A").NumberFormat = "@" If this post helps click Yes --------------- Jacob Skaria "programinfinity" wrote: Hi, I'm trying to create an excel sheet using html <table tags from vbscript. One of the columns contains numbers 14 digits long. On opening the file created it shows the numbers as 2.3024E+13. I tried adding an apostrophe ( ' ) before the number. But sadly the apostrophe also shows on the excel sheet. How can I prevent the number to convert to scientific format and display all 14 digits either as number or text? Thanks in advance, programinfinity |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent scientific formatting when creating excel sheet from v
Thank you! It worked perfectly.
- programinfinity "Tim Williams" wrote: <table <tr <td style='mso-number-format:\@;'12345678912345667</td </tr </table Tim "programinfinity" wrote in message ... thanks for the reply, the excel sheet is also newly created by the vbscript so i cannot format the column before. is there something I can set in the column properties while writing out the excel file the same way I can set widths - like using 'mso-width-source:userset;mso-width-alt:3754;width:105pt'? i need to email out the excel sheet from the script so I can't edit and change the format either. - programinfinity "Jacob Skaria" wrote: Format the column to Text before placing the text Range("A:A").NumberFormat = "@" If this post helps click Yes --------------- Jacob Skaria "programinfinity" wrote: Hi, I'm trying to create an excel sheet using html <table tags from vbscript. One of the columns contains numbers 14 digits long. On opening the file created it shows the numbers as 2.3024E+13. I tried adding an apostrophe ( ' ) before the number. But sadly the apostrophe also shows on the excel sheet. How can I prevent the number to convert to scientific format and display all 14 digits either as number or text? Thanks in advance, programinfinity |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prevent scientific formatting when creating excel sheet from v
No problem.
The easiest way to get the correct style is to format cells in an Excel sheet, save as HTML, and inspect the source for the styles. Tim "programinfinity" wrote in message ... Thank you! It worked perfectly. - programinfinity "Tim Williams" wrote: <table <tr <td style='mso-number-format:\@;'12345678912345667</td </tr </table Tim "programinfinity" wrote in message ... thanks for the reply, the excel sheet is also newly created by the vbscript so i cannot format the column before. is there something I can set in the column properties while writing out the excel file the same way I can set widths - like using 'mso-width-source:userset;mso-width-alt:3754;width:105pt'? i need to email out the excel sheet from the script so I can't edit and change the format either. - programinfinity "Jacob Skaria" wrote: Format the column to Text before placing the text Range("A:A").NumberFormat = "@" If this post helps click Yes --------------- Jacob Skaria "programinfinity" wrote: Hi, I'm trying to create an excel sheet using html <table tags from vbscript. One of the columns contains numbers 14 digits long. On opening the file created it shows the numbers as 2.3024E+13. I tried adding an apostrophe ( ' ) before the number. But sadly the apostrophe also shows on the excel sheet. How can I prevent the number to convert to scientific format and display all 14 digits either as number or text? Thanks in advance, programinfinity |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I prevent Excel from automatically creating hyperlinks? | Excel Discussion (Misc queries) | |||
Prevent conversion of numeric text string to scientific notation | Excel Discussion (Misc queries) | |||
How to prevent General format from using scientific notation? | Excel Discussion (Misc queries) | |||
Prevent Scientific Notation | Excel Discussion (Misc queries) | |||
How to get the number of used rows from excel spreadsheet in VBScr | Excel Programming |