Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm gathering numbers (text) from a screen and want to format it in telephone
format before I place it in the spreadsheet. First, I need to remove the underscores and have that in place which works. "RemoveUnderscores" is a subroutine that gets rid of the underscores. The problem is when there is no phone number to grab, I get and left/right brackets along with the underscores. I would think that Else CPPHONE = "" would work. ScreenTextB is actually pulling the object for me and it works fine. Dim CPPHONE as String RemoveUnderscores If Len(ScreenTextB) = 12 Then CPPHONE = "(" & Left(ScreenTextB, 3) & ") " & Mid(ScreenTextB, 5, 3) & "-" & Right(ScreenTextB, 4) Else CPPHONE = "" End If Thank you for your help! Tom |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
removing characters | Excel Discussion (Misc queries) | |||
Removing characters | Excel Discussion (Misc queries) | |||
Removing characters | Excel Discussion (Misc queries) | |||
Removing characters | Excel Worksheet Functions | |||
removing first three characters | Excel Programming |