Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
html markup to specify data type of cells in Excel
Please can anyone tell me how to specify in html that the data-type of
a column is text rather than general. I am generating an html table using XSL to be opened in Excel but one column loses it's leading zeros and I therefore want to specify the above in the output html. Any help will be gratefully received. Redge |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
html markup to specify data type of cells in Excel
Hi Redge,
If you can use a CSS style attribute, this should work for you (shown here applied to a <td element): <td style="mso-number-format:\@"00001</td -- Regards, Jake Marx MS MVP - Excel www.longhead.com [please keep replies in the newsgroup - email address unmonitored] Red Ogden wrote: Please can anyone tell me how to specify in html that the data-type of a column is text rather than general. I am generating an html table using XSL to be opened in Excel but one column loses it's leading zeros and I therefore want to specify the above in the output html. Any help will be gratefully received. Redge |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
html markup to specify data type of cells in Excel
Many thanks for that Jake.
|
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
html markup to specify data type of cells in Excel
Red Ogden wrote:
Many thanks for that Jake. No problem, Redge. Just to help you solve problems like this in the future, here are the steps I took to determine the style needed in this case: 1) formatted column A as text 2) entered number 00012 in cell A1 3) entered number 00012 in cell B1 (changed to 12 when entered) 4) opened the Microsoft Script Editor (Alt+Shift+F11) 5) located the <column that contained 00012 6) saw that the class assigned to that <column is named "xl24" 7) located ".xl24" in the <style block in the page header 8) noticed the "mso-number-format" style and copied it 9) created a new HTML document with a simple table 10) in one <td, set the style attribute to text copied from step 8 11) in that <td, use the value 00012 12) in another <td, use the value 00012 13) save the HTML document 14) open the document with Excel 15) notice that the first cell comes through with leading 0's and the second doesn't -- Regards, Jake Marx MS MVP - Excel www.longhead.com [please keep replies in the newsgroup - email address unmonitored] |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Remove html markup tags in an EXCEL cell? | Excel Discussion (Misc queries) | |||
Can I view stylistic formatting markup in Excel as in Word? | Excel Discussion (Misc queries) | |||
Remove html markup | Excel Worksheet Functions | |||
How to alter data on HTML webpage into Excell cells as numbers? | New Users to Excel | |||
Margin/markup formula for Excel | New Users to Excel |