Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ExcelSheet.Format Styles for Text
#1
Anyone know what the style code for text/string is?

The help shows:
Quote:x - variable with formats:
  style - style name (string).
    In Excel there are several predefined styles ("Currency", "Percent"...). User can define more styles.
    Use "Normal" to reset all existing formatting.
  numberFormat - number format (string).
    To see number format strings for predefined formats: In Excel "Format Cells" dialog select a format and then select "Custom".
(...)
Example:
x.style="Normal"

The "Normal" is "general", but which one sets the style to Text so that editing UPCs and stuff won't switch to scientific?

x.style="Text" errors with invalid number of parameters. Date and Time also don't seem to work.. So all of the ones not listed in the help file. hah.

Anyone know what the style code is for these styles?

Thanks,
#2
Sorry, I just realized this isn't QM code.. it's an imported library.
https://www.codeproject.com/Articles/425...at-Library

Apparently @ is text.

Text - "@"
Integer - "0"
Decimal - "0.00"
Percent - "0%"
Date - "M/D/YY"
Time - "h:mmConfuseds"
Datetime - "M/D/YY h:mm"

But as opposed to the library's help, you would use 
x.numberFormat="@"
instead of
x.style="@"


x.style="Normal" sets the style to General


Thanks to everyone who looked at this. I hope this helps someone in the future.


Forum Jump:


Users browsing this thread: 1 Guest(s)