Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Telephone number data type?

Hi,

I'm trying to write a program using a spreadsheet that has two columns for
the telephone number: the first is the actual telephone number, but in some
cases it refers to the data circuit and the actual tel no is in the second
column. I can tell if the tel no is a circuit by the number being AREA CODE
and then a 1, followed by 6 digits (for example, 4161334444). I need to
figure out how to use the second column of telephone numbers when this
happens (which is only about 3% of the time, but these are critical to my
business). But for some reason, I cannot figure out what data type i need to
use (I've tried string, variant, and integer) all to no avail...
Right now, the code looks like this (feel free to laugh, i've been working
on this for about 35 hours since Thursday morning and am a wee bit fried)...

Dim Telno As String
Dim Auxno As String

If Range("Telno") = "5191*" Then
Range("Auxno").Copy
Range("Telno").Paste
End If

End Sub

I would appreciate any help as soon as possible.....I need this program up
and running by tomorrow afternoon...groan...
Chris
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Telephone number data type?

I think you need to use text strings as in your example. You need to
distinguish a circuit number from a phone number and you state a circuit
number is an area code followed by a "1" followed by only six digits. This
is 10 digits, the same as a phone number.

Since you can't use length to distinguish, use the fourth character in the
string:

=MID(A1,4,1)

If this is a "1", its a circuit number and get the phone number elsewhere.
--
Gary''s Student


"ChrisBat" wrote:

Hi,

I'm trying to write a program using a spreadsheet that has two columns for
the telephone number: the first is the actual telephone number, but in some
cases it refers to the data circuit and the actual tel no is in the second
column. I can tell if the tel no is a circuit by the number being AREA CODE
and then a 1, followed by 6 digits (for example, 4161334444). I need to
figure out how to use the second column of telephone numbers when this
happens (which is only about 3% of the time, but these are critical to my
business). But for some reason, I cannot figure out what data type i need to
use (I've tried string, variant, and integer) all to no avail...
Right now, the code looks like this (feel free to laugh, i've been working
on this for about 35 hours since Thursday morning and am a wee bit fried)...

Dim Telno As String
Dim Auxno As String

If Range("Telno") = "5191*" Then
Range("Auxno").Copy
Range("Telno").Paste
End If

End Sub

I would appreciate any help as soon as possible.....I need this program up
and running by tomorrow afternoon...groan...
Chris

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Telephone number data type?

Boy, I've obviously been drinking too much coffee (or not
enough......)....That's such a simple answer, why was I looking for something
more complicated? :-)
Thanks a lot,
Chris

"Gary''s Student" wrote:

I think you need to use text strings as in your example. You need to
distinguish a circuit number from a phone number and you state a circuit
number is an area code followed by a "1" followed by only six digits. This
is 10 digits, the same as a phone number.

Since you can't use length to distinguish, use the fourth character in the
string:

=MID(A1,4,1)

If this is a "1", its a circuit number and get the phone number elsewhere.
--
Gary''s Student


"ChrisBat" wrote:

Hi,

I'm trying to write a program using a spreadsheet that has two columns for
the telephone number: the first is the actual telephone number, but in some
cases it refers to the data circuit and the actual tel no is in the second
column. I can tell if the tel no is a circuit by the number being AREA CODE
and then a 1, followed by 6 digits (for example, 4161334444). I need to
figure out how to use the second column of telephone numbers when this
happens (which is only about 3% of the time, but these are critical to my
business). But for some reason, I cannot figure out what data type i need to
use (I've tried string, variant, and integer) all to no avail...
Right now, the code looks like this (feel free to laugh, i've been working
on this for about 35 hours since Thursday morning and am a wee bit fried)...

Dim Telno As String
Dim Auxno As String

If Range("Telno") = "5191*" Then
Range("Auxno").Copy
Range("Telno").Paste
End If

End Sub

I would appreciate any help as soon as possible.....I need this program up
and running by tomorrow afternoon...groan...
Chris

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Telephone number data type?

Thanks for the feed-back. Next time don't wait 35 hours to post.
--
Gary''s Student


"ChrisBat" wrote:

Boy, I've obviously been drinking too much coffee (or not
enough......)....That's such a simple answer, why was I looking for something
more complicated? :-)
Thanks a lot,
Chris

"Gary''s Student" wrote:

I think you need to use text strings as in your example. You need to
distinguish a circuit number from a phone number and you state a circuit
number is an area code followed by a "1" followed by only six digits. This
is 10 digits, the same as a phone number.

Since you can't use length to distinguish, use the fourth character in the
string:

=MID(A1,4,1)

If this is a "1", its a circuit number and get the phone number elsewhere.
--
Gary''s Student


"ChrisBat" wrote:

Hi,

I'm trying to write a program using a spreadsheet that has two columns for
the telephone number: the first is the actual telephone number, but in some
cases it refers to the data circuit and the actual tel no is in the second
column. I can tell if the tel no is a circuit by the number being AREA CODE
and then a 1, followed by 6 digits (for example, 4161334444). I need to
figure out how to use the second column of telephone numbers when this
happens (which is only about 3% of the time, but these are critical to my
business). But for some reason, I cannot figure out what data type i need to
use (I've tried string, variant, and integer) all to no avail...
Right now, the code looks like this (feel free to laugh, i've been working
on this for about 35 hours since Thursday morning and am a wee bit fried)...

Dim Telno As String
Dim Auxno As String

If Range("Telno") = "5191*" Then
Range("Auxno").Copy
Range("Telno").Paste
End If

End Sub

I would appreciate any help as soon as possible.....I need this program up
and running by tomorrow afternoon...groan...
Chris

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
Format a Telephone number LeeE Excel Worksheet Functions 2 November 3rd 09 11:14 PM
How can I click on a telephone number in an Excel 2002 spreadsheet, and have the number dialed? jbclem Excel Discussion (Misc queries) 2 August 13th 09 01:57 AM
telephone number format John[_17_] Excel Discussion (Misc queries) 3 April 12th 09 06:12 PM
How do I format to telephone number Stan in South Africa Excel Discussion (Misc queries) 4 November 10th 08 06:05 PM
Telephone number format MarkT Excel Discussion (Misc queries) 6 January 18th 05 10:39 PM


All times are GMT +1. The time now is 11:42 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"