![]() |
#2
|
||||
|
||||
![]()
Try:
Code:
Sub Demo() Application.ScreenUpdating = False Dim Amt As Single With ActiveDocument.Range With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "EUR [0-9.]@m" .Replacement.Text = "" .Forward = True .Wrap = wdFindStop .Format = False .MatchWildcards = True .Execute End With Do While .Find.Found Amt = Amt + CSng(Split(Split(.Text, " ")(1), "m")(0)) .Collapse wdCollapseEnd .Find.Execute Loop End With Application.ScreenUpdating = True MsgBox "EUR " & Amt & "m" End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
DelHop | Word Tables | 11 | 11-24-2019 02:37 PM |
Adding addresses and $ amounts to Word docs | littlepeaks | Word VBA | 2 | 01-22-2016 07:57 PM |
Macro to find a word in first row of table and then perform two macros | hmsrose | Word VBA | 5 | 01-30-2015 12:17 AM |
![]() |
jungkim | Word | 2 | 03-24-2012 07:40 AM |
![]() |
Jennifer_Falcon | Word VBA | 6 | 07-26-2011 10:49 AM |