macro that strips data from string



Hi,
I am new to VBA & Macros. Appreciate any help I can get. I have a macro that
strip's data from a string and it works fine except I need it to strip
further in the string. example of results:
bunder_linn-S1/0-720L-140.55.135.34-NIPR-1.5M(In)

What I need is to strip from the second - to the (
example: bunder_linn-S1/0-720L-140.55.135.34-NIPR-1.5M(In)


It can strip and copy to clipboard or to cell b1. Either way will work. This
macro was in a word doc, will it work in excel also?

Sub AREA_REPORT()
'
' AREA_REPORT Macro
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "[-]*[(]"
.Replacement.Text = " ("
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.WholeStory
Selection.Cut
End Sub

Thanks,
Calop


.



Relevant Pages

  • Compile-time text/string manipulation
    ... A "compile-time language" is one that processes ... Compile time languages for assemblers ... This group includes macro ... requires access to various string and text manipulation ...
    (alt.lang.asm)
  • RE: Search email for text string to use in filename - save email t
    ... The code for my macro is below. ... .MatchWholeWord = False ... Dim sNewFileName As String ... > 0 Then Exit Function ...
    (microsoft.public.outlook.program_vba)
  • Re: Removing only certain data in a cell
    ... Macro to strip all but 123-456-7890. ... Dim rngR As Range, rngRR As Range ... Dim strNotNum As String, strTemp As String ...
    (microsoft.public.excel.misc)
  • Re: Document Property to display more than 1 line
    ... then use the following macro to identify the character ... Dim strNums As String ...
    (microsoft.public.word.newusers)
  • Re: Form refresh code
    ... Your version of the InserrtAddress macro also unlocked the field with the ... string variable name in the protect/unprotect commands. ... Public Sub InsertAddressFromOutlook() ... Dim strCode As String, strAddress As String ...
    (microsoft.public.word.docmanagement)