#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Format Question

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 133
Default Format Question

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



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Format Question

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




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 64
Default Format Question

Format Cells Special Telephone Number

"Dabeaks" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.misc
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Yet Another Name Format Question Dallas PM Excel Discussion (Misc queries) 3 April 1st 08 10:01 PM
Format question Richard Excel Discussion (Misc queries) 3 March 8th 08 03:00 PM
Format Question Ankeny JJ Excel Discussion (Misc queries) 2 November 21st 06 03:03 PM
Format question Luis Excel Discussion (Misc queries) 1 June 22nd 05 02:42 PM
Format Question Please WILLIAM DAVIS Excel Discussion (Misc queries) 2 January 7th 05 01:45 AM


All times are GMT +1. The time now is 05:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"