Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default html markup to specify data type of cells in Excel

Many thanks for that Jake.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default 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
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
Remove html markup tags in an EXCEL cell? glennwhite Excel Discussion (Misc queries) 3 June 5th 06 07:25 AM
Can I view stylistic formatting markup in Excel as in Word? Dena Excel Discussion (Misc queries) 1 March 1st 06 09:49 PM
Remove html markup Stuart Excel Worksheet Functions 19 November 25th 05 03:47 PM
How to alter data on HTML webpage into Excell cells as numbers? roameri New Users to Excel 6 July 31st 05 11:42 PM
Margin/markup formula for Excel Wardo New Users to Excel 3 January 3rd 05 06:01 PM


All times are GMT +1. The time now is 06:48 AM.

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

About Us

"It's about Microsoft Excel"