Thread: Format Question
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Format Question

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

Dabeaks wrote:

Daniel,

Maybe I'm doing it wrong. but I copied and pasted that into the "record
Macro" description. I also enabled the Macros. Nothing changed at all after
this. Am I missing a step? This is the first time I'm using Macros in excel.

Adam

"Daniel.C" wrote:

Hello.
Try the following macro :

Sub test()
Dim c As Range
For Each c In Selection
If c.NumberFormat = "###"".""###"".""####" Or _
c.NumberFormat = "###\.###\.####" Then
c.NumberFormat = "(###) ###-###"
End If
Next c
End Sub

HTH
Daniel

Hello,

I have a whole bunch of phone numbers listed in the following format:

###.###.####

Is there a way to change all of them to this format:

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

Please help





--

Dave Peterson