C
Calop
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
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