Custom Format Data inside a Cell

I have a column of numbers in the following format:

(###) ###-####

and I would like to write a macro that changes the previous format to the following:

[fax: (###) ###-###]

where the text "[fax:" is added at the beginning and a closing bracket "]" at the end.

Could you offer help on creating this macro, or other suggestions on how to fix this in Excel

Thank you!



Answer this question

Custom Format Data inside a Cell

  • JohnHarding

    If what you specied for the format is a custom format, change it to:

    "[fax: "(###) ###-####"]" (including all double-quotes)

    If the non-numeric formating elements are data in the cell use this macro:

    Sub AddFax()
    Selection.Value = "[fax: " & Selection.Value & "]"
    End Sub

    I would set up a keyboard shortcut for this to make life a little easier.

    rusty


  • Iota Studios

    Thank you very much! This worked. I appreciate yourh elp.
  • Custom Format Data inside a Cell