Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You need a macro. Are you looking to extact all numeric strings starting
with space followed by "HW" (including the one at the beginning of the line with no space)? call with =GetHW(A1) Function GetHW(Target) GetHW = "" charcount = 1 Do While charcount <= Len(Target) If Mid(Target, charcount, 2) = "HW" Then If GetHW < "" Then 'add blank between strings GetHW = GetHW & " HW" Else GetHW = "HW" End If 'extract number charcount = charcount + 2 Do While IsNumeric(Mid(Target, charcount, 1)) GetHW = GetHW & Mid(Target, charcount, 1) charcount = charcount + 1 Loop Else charcount = charcount + 1 End If Loop End Function "BRB" wrote: Have a variation to a previous question: Need to copy a string of characters from one cell to another. Here is what the cell looks like: Cells: A1 = Some text, HW012345, more text, HW034567, more text A2 = Some text A3 = Some text, HW056783, more text, HW035791, more text In column B I need the following result: B1 = HW012345 HW034567 B2 = (blank) B3 = HW056783 HW035791 Thanks for any help |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Count characters within a string | Excel Worksheet Functions | |||
Separate characters in a string | Excel Discussion (Misc queries) | |||
summing characters in a string | Excel Worksheet Functions | |||
select a string of characters | Excel Worksheet Functions | |||
pulling characters out of a string | Excel Worksheet Functions |