Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Phone book formatting

How do I create a format that will insert the appropriate number of dots
between the name and the phone number so that I'll have the name
left-aligned and the phone number right-aligned, as in the folllowing
example:

Anthony Hopkins............942-4567 (35 characters)

Thanks,
Jim Berglund

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default Phone book formatting

A few questions...

1) How is the name entered manually of progammaticly
2) specific Range or no?
3)How is the phone number entered?

"Jim Berglund" wrote:

How do I create a format that will insert the appropriate number of dots
between the name and the phone number so that I'll have the name
left-aligned and the phone number right-aligned, as in the folllowing
example:

Anthony Hopkins............942-4567 (35 characters)

Thanks,
Jim Berglund


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Phone book formatting

Is this all supposed to be in 1 cell? Is the source data in seperate cells?
Is it always supposed to be 35 characters in length which implies you are
using a non-proportional font like courier?
--
HTH...

Jim Thomlinson


"Jim Berglund" wrote:

How do I create a format that will insert the appropriate number of dots
between the name and the phone number so that I'll have the name
left-aligned and the phone number right-aligned, as in the folllowing
example:

Anthony Hopkins............942-4567 (35 characters)

Thanks,
Jim Berglund


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Phone book formatting

If you're doing this to create a mini-phonebook, you may find that you have lots
more formatting choices if you did it in MSWord.

Jim Berglund wrote:

How do I create a format that will insert the appropriate number of dots
between the name and the phone number so that I'll have the name
left-aligned and the phone number right-aligned, as in the folllowing
example:

Anthony Hopkins............942-4567 (35 characters)

Thanks,
Jim Berglund


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default Phone book formatting

Assuming Names and phone number a entered manually try this

Option Explicit

Sub AddDots()
Dim Rng As Range
Dim i As Variant

Set Rng = Range("A1:A65536")
i = Cells

For Each i In Rng
i.Offset(1, 0).Select
If i.Value < "" Then
i.Offset(0, 1).Select
ActiveCell.Value = "..................................."
ElseIf i.Value = "" Then
End If
Next
End Sub


"Dave Peterson" wrote:

If you're doing this to create a mini-phonebook, you may find that you have lots
more formatting choices if you did it in MSWord.

Jim Berglund wrote:

How do I create a format that will insert the appropriate number of dots
between the name and the phone number so that I'll have the name
left-aligned and the phone number right-aligned, as in the folllowing
example:

Anthony Hopkins............942-4567 (35 characters)

Thanks,
Jim Berglund


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Phone book formatting

I'm not sure that the OP wanted a separate cell to show the dot leader.

Office_Novice wrote:

Assuming Names and phone number a entered manually try this

Option Explicit

Sub AddDots()
Dim Rng As Range
Dim i As Variant

Set Rng = Range("A1:A65536")
i = Cells

For Each i In Rng
i.Offset(1, 0).Select
If i.Value < "" Then
i.Offset(0, 1).Select
ActiveCell.Value = "..................................."
ElseIf i.Value = "" Then
End If
Next
End Sub

"Dave Peterson" wrote:

If you're doing this to create a mini-phonebook, you may find that you have lots
more formatting choices if you did it in MSWord.

Jim Berglund wrote:

How do I create a format that will insert the appropriate number of dots
between the name and the phone number so that I'll have the name
left-aligned and the phone number right-aligned, as in the folllowing
example:

Anthony Hopkins............942-4567 (35 characters)

Thanks,
Jim Berglund


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Phone book formatting

I would add another columns with the dots. Then use a formula like this

=Rept(".",35 - len(A10))

where A10 is the cell wi the person name. Rept will repeat the dot x number
of times.

"Jim Berglund" wrote:

How do I create a format that will insert the appropriate number of dots
between the name and the phone number so that I'll have the name
left-aligned and the phone number right-aligned, as in the folllowing
example:

Anthony Hopkins............942-4567 (35 characters)

Thanks,
Jim Berglund


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Phone book formatting

Thanks all. Joel certainly had the simplest solution. Problem solved!
Jim
"Jim Berglund" wrote in message
...
How do I create a format that will insert the appropriate number of dots
between the name and the phone number so that I'll have the name
left-aligned and the phone number right-aligned, as in the folllowing
example:

Anthony Hopkins............942-4567 (35 characters)

Thanks,
Jim Berglund


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Phone book formatting

Note that that solution only works with a non-propotional font like courier.
With Arial and other proportional fonts each character is a different width
and 35 characters will take up different amount so space.
--
HTH...

Jim Thomlinson


"Jim Berglund" wrote:

Thanks all. Joel certainly had the simplest solution. Problem solved!
Jim
"Jim Berglund" wrote in message
...
How do I create a format that will insert the appropriate number of dots
between the name and the phone number so that I'll have the name
left-aligned and the phone number right-aligned, as in the folllowing
example:

Anthony Hopkins............942-4567 (35 characters)

Thanks,
Jim Berglund



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Phone book formatting

Thanks, all of you.
I liked Joel's response, best - short, easy, and it works!
Jim

"Jim Berglund" wrote in message
...
How do I create a format that will insert the appropriate number of dots
between the name and the phone number so that I'll have the name
left-aligned and the phone number right-aligned, as in the folllowing
example:

Anthony Hopkins............942-4567 (35 characters)

Thanks,
Jim Berglund




  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Phone book formatting

I don't know.

Using MSWord is pretty simple for tables like this. Changing the formatting for
the tab character is pretty simple, too.

Jim Berglund wrote:

Thanks, all of you.
I liked Joel's response, best - short, easy, and it works!
Jim

"Jim Berglund" wrote in message
...
How do I create a format that will insert the appropriate number of dots
between the name and the phone number so that I'll have the name
left-aligned and the phone number right-aligned, as in the folllowing
example:

Anthony Hopkins............942-4567 (35 characters)

Thanks,
Jim Berglund


--

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
Formatting phone numbers LMR Excel Discussion (Misc queries) 5 March 4th 08 08:46 PM
Phone Formatting Jim Excel Discussion (Misc queries) 9 July 14th 07 05:38 AM
Phone book problem Padraigglynn Excel Worksheet Functions 3 March 11th 07 03:59 PM
Formatting a Phone Number Formatting Phone Number Excel Discussion (Misc queries) 3 April 6th 06 08:23 PM
Phone Number Formatting Brant Nyman Excel Discussion (Misc queries) 5 August 25th 05 06:56 PM


All times are GMT +1. The time now is 07:15 PM.

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

About Us

"It's about Microsoft Excel"