Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I didn't know if you wanted a string or a number returned, so I returned a
string Use custom function below Call with =Get2ndString(A1) Strings that don't have two periods will give errors where A1 is any cell containing a string Function Get2ndString(Cell As Range) As String 'get first period Period = InStr(Cell, ".") 'get string after 1st period Get2ndString = Mid(Cell, Period + 1) 'get second period Period = InStr(Get2ndString, ".") Get2ndString = Left(Get2ndString, Period - 1) End Function "XP" wrote: Given data like the following: B.3.54 A.14.1 BC.323.88493 ABC.1.4993 I need to always extract the first value after the first dot (reading left to right). So, continuing in the example shown, I need to get: 3; 14; 323; and 1; This runs on one line at a time so I need to be able to just get one value at a time copied into a variable. Can someone please post example code that can do this? Thanks much in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Extract from string | Excel Discussion (Misc queries) | |||
Extract certain parts of string | Excel Worksheet Functions | |||
extract string | Excel Programming | |||
Extract sub string | Excel Worksheet Functions | |||
extract string | Excel Programming |