View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Formatting numbers

I'm not sure what you mean by "the response". If you execute that line, as
written, it should perform the format operation... if you include as part of
a larger line of code, well, then I'd have to see exactly how you are trying
to use it in order to make a guess at what is happening.

--
Rick (MVP - Excel)


"fred" wrote in message
...
Sorry, my fault. Syntax error.
When I try this:
moExcelWS.Cells(3,3).NumberFormat = "[<=9999999]###-####;(###) ###-####"
the response is (True/False) which indicates to me that it is comparing
the formats not introducing it.
Fred

"fred" wrote in message
...
Thank you, Rick
When I try this:
moExcelWS.Cells.(3,3)NumberFormat="[<=9999999]###-####;(###) ###-####"
there is a compile error:
"Expected: identifier or bracketed expression"

I wonder, if there is way to "preformat" the whole column, so when the
numbers are entered into it they will be automatically formatted as the
phone numbers?
Thanks,
Fred

"Rick Rothstein" wrote in message
...
Not sure how you want to implement this, but the following should give
you an idea how to proceed...

Selection.NumberFormat = "[<=9999999]###-####;(###) ###-####"

--
Rick (MVP - Excel)


"fred" wrote in message
...
Hello,
When using Excel automation, how to programmatically format
all numbers in the specified column as the phone numbers.
I can see it in the Excel menu there is possible to do
FormatSpecialPhone Numbers.
How to do that programmatically?
Thanks,
Fred