Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default 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
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
Capturing Date Larry Fish via OfficeKB.com New Users to Excel 4 September 27th 06 01:40 PM
Capturing the column number and # of columns in a selection Ralph Heidecke[_2_] Excel Programming 2 March 18th 05 06:27 PM
Capturing deletion of a row Glen Mettler[_4_] Excel Programming 3 December 12th 04 01:01 AM
Capturing an Error cskgg[_2_] Excel Programming 1 July 26th 04 07:08 AM
Capturing user name Syed Faisal[_2_] Excel Programming 4 November 18th 03 05:59 PM


All times are GMT +1. The time now is 11:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"