LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Question on Removing Characters

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
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
removing characters DEI[_2_] Excel Discussion (Misc queries) 7 April 29th 08 09:02 PM
Removing characters Maksko Excel Discussion (Misc queries) 8 November 3rd 06 11:26 AM
Removing characters Maksko Excel Discussion (Misc queries) 7 October 19th 06 02:26 PM
Removing characters Tomsriv Excel Worksheet Functions 2 August 14th 06 11:54 PM
removing first three characters Tiffany[_4_] Excel Programming 4 September 16th 04 11:30 PM


All times are GMT +1. The time now is 03:42 AM.

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"