Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need hlp capturing a certain pattrern from a column
Hi every1!!!
Need to isolate into a different column a value that was found into another one. Example: COL1 COL2 test 123 123 Would like to copy the number part only into another column, using already existing functions are by means of a custum function PS. Probably need a custum function, cuz this needs to be applied to 2000+ lines in an excel spreadsheet. How would i go about this? Thx for all your hlp!!!! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need hlp capturing a certain pattrern from a column
Here is a function I use to find the first number in a string
Public Function FirstNumber(ByVal InputString As String) As Integer Dim intCounter As Integer Dim intStringLength As Integer Dim intReturnValue As Integer intReturnValue = -1 intStringLength = Len(InputString) For intCounter = 1 To intStringLength If IsNumeric(Mid(InputString, intCounter, 1)) Then intReturnValue = intCounter Exit For End If Next intCounter FirstNumber = intReturnValue End Function place this code in a module and you will be able to use it as a formula in your spreadsheet. You would use it something like. =MID(A1, firstnumber(A1), 100) Where "Test 123" was in A1 HTH Jim Thomlinson "Patrick" wrote: Hi every1!!! Need to isolate into a different column a value that was found into another one. Example: COL1 COL2 test 123 123 Would like to copy the number part only into another column, using already existing functions are by means of a custum function PS. Probably need a custum function, cuz this needs to be applied to 2000+ lines in an excel spreadsheet. How would i go about this? Thx for all your hlp!!!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Capturing Date | New Users to Excel | |||
Capturing the column number and # of columns in a selection | Excel Programming | |||
Capturing deletion of a row | Excel Programming | |||
Capturing an Error | Excel Programming | |||
Capturing user name | Excel Programming |