LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #22   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default regEx replace

"GS" wrote:


Function FormatPhoneNumber$(TextIn$)
' .......
End Function 'FormatPhoneNumber()

Function FilterString$(ByVal TextIn$, Optional IncludeChars$, _
' ........
End Function 'FilterString()


Hey Gary. Thanks again for this code. I knew you always
had an alternative to regular expressions.


Ugh! It only handles North American phone numbers. I can see a use,
though, for having a function that formats based on country!

<FWIW
I use Farpoint's Spread.ocx in VB6 projects to duplicate my Excel
projects as stand-alone Windows apps for users that don't/won't use MS
Office. This control requires using code to replicate many of the
built-in Excel features it doesn't have. This is one function I make
use of for customer/vendor lists or contact info lists. It obviates
using a separate field if an (optional) extension is used with my
default Phone1/Phone2 data fields. I also have a function to format
credit card numbers, but haven't had need to format social security
numbers (yet).

The 3 Excel features I replicate by code most often are Group/Ungroup,
DV lists (which use a 'Combobox cell type' in place of a regular cell),
and CF. There are 15 'cell types' in all, many of which have restricted
'data type' input by default as their respective 'data validation'
feature. Thus, using 'dependant dropdowns' is also entirely managed by
code.

I also have the option to use multi-column dropdowns and multiple
header rows/cols. The latter can be replicated in Excel by using
FreezePanes, but this doesn't permit using FreezePanes in the
non-header cell area. Events is the primary code vehicle for
implementation.

Group/Ungroup is a bit tricky in that a hidden helper column is needed
to 'map' the range extent of a group. The coding is rather simple,
though, and I have the option of using a 'picture' cell type to display
whatever expand/collapse symbols I choose to use. I normally don't use
symbols, but rather use event code for the cell containing the group
'label' text. For example, expense/income/bank ledger sheets group
transactions for a fiscal period by month. Clicking a month 'label'
toggles expand/collapse of row details. On the expense/income ledger
sheets, clicking a Detail label toggles expand/collapse of the month
distribution cols. I like that this technique saves the screen real
estate lost by displaying the group/outline symbols Excel uses.

Fortunately the Spread.ocx has all the common built-in formula
functions I need, but it also supports UDFs.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


 
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
Regex Pattern Geoff K Excel Programming 5 June 12th 09 12:49 AM
Regex as replace function Excel Monkey[_2_] Excel Programming 3 May 7th 09 06:46 PM
Help with a regex pattern please [email protected] Excel Programming 3 March 22nd 08 12:14 AM
Help with a Regex Pattern [email protected] Excel Programming 11 April 30th 07 01:49 AM
Regex techniques Dave Runyan Excel Programming 5 April 28th 07 12:17 AM


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