View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Put parentheses around figures

Range("A1").NumberFormat = "(##-###-##-##)"
Range("A1") = 123456789
Columns("A:A").EntireColumn.AutoFit

Manually, select your cells, Ctrl-1, Custom, Type: the above number-format
without the quotes

FWIW, numbers in brackets are typically regarded as -ve. Post back if that's
the objective as the -ve format should follow the +ve format, separated with
a comma.

Regards,
Peter T

"andreashermle" wrote in message
...
Dear Experts:

I would like to format selected figures with a specific syntax so that
after running the macro parentheses are put around the numbers

Befo
xx-xxx-xx-xx (x stands for any number 0-9)

After (the result):
(xx-xxx-xx-xx)

Help is much appreciated. Thank you very much in advance.

Regards, Andreas