Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.newusers
|
|||
|
|||
Excel 2003 Find and Replace
I have a column of numbers. Some numbers vary in the number of characters
and some are strickly numbers; others are a mix of numbers and letters. I would like to replace those numbers with the same numbers but with parenthesis around each of them. How do I do that? |
#2
Posted to microsoft.public.excel.newusers
|
|||
|
|||
Excel 2003 Find and Replace
Paste a representative sample of your data into a post so's we can have a look.
Gord Dibben MS Excel MVP On Sun, 2 Dec 2007 12:20:01 -0800, jr0410 wrote: I have a column of numbers. Some numbers vary in the number of characters and some are strickly numbers; others are a mix of numbers and letters. I would like to replace those numbers with the same numbers but with parenthesis around each of them. How do I do that? |
#3
Posted to microsoft.public.excel.newusers
|
|||
|
|||
Excel 2003 Find and Replace
On Sun, 2 Dec 2007 12:20:01 -0800, jr0410
wrote: I have a column of numbers. Some numbers vary in the number of characters and some are strickly numbers; others are a mix of numbers and letters. I would like to replace those numbers with the same numbers but with parenthesis around each of them. How do I do that? If I understand you correctly, you would want the string: ab12ab33 to change to: ab(1)(2)ab(3)(3) This UDF will do that. To enter the UDF, <alt-F11 opens the VBEditor. Ensure your project is highlighted in the Project Explorer window, then Insert/Module and paste the code below into the window that opens. To use this function, enter a formula of the type: =parennums(A1) If you want different functionality, it's pretty easy to change this. Post back. ================================ Option Explicit Function ParenNums(str As String) As String Dim re As Object Set re = CreateObject("vbscript.regexp") re.Global = True re.Pattern = "(\d)" ParenNums = re.Replace(str, "($1)") End Function ============================================== --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find & Replace Option in Excel 2003 | Setting up and Configuration of Excel | |||
Excel 2003 Find and Replace is changed to previovois ver.-awful!! | Excel Discussion (Misc queries) | |||
find and replace links in Excel 2003 | Excel Worksheet Functions | |||
Find and replace Excel, Office pro 2003 | Excel Discussion (Misc queries) | |||
Find and replace for comments in excel 2003 | Excel Discussion (Misc queries) |