![]() |
#9
|
|||
|
|||
![]()
Hss001, try this one:
Code:
Sub Find_Wd_N_Select_Sent() 'In the selected range, find the inputboxed wd & select the 1st sentence it is in. Dim oRng As range Dim strWd As String Set oRng = selection.range strWd = InputBox("Enter the word to find", "FIND") With oRng.Find .ClearFormatting .Replacement.ClearFormatting .text = strWd .Replacement.text = "" .Forward = True .Wrap = wdFindStop .Format = False .MatchWildcards = False If .Execute Then oRng.Select selection.Extend: selection.Extend: selection.Extend End If End With Set oRng = Nothing End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
littlepeaks | Word VBA | 10 | 08-09-2022 12:12 PM |
![]() |
Swarup | Word | 11 | 07-26-2022 01:51 PM |
![]() |
mrplastic | Word VBA | 4 | 12-20-2019 01:25 PM |
Word for Mac 2011: Problems accessing Text Boxes programmatically | techy291 | Word VBA | 0 | 07-16-2017 08:41 AM |
![]() |
RBusiness | Word | 1 | 06-07-2011 04:26 PM |