Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 04-01-2014, 01:42 AM
Hoxton118 Hoxton118 is offline Insert input box into macro to allow user to choose multiple text entries Windows 7 32bit Insert input box into macro to allow user to choose multiple text entries Office 2010 32bit
Novice
Insert input box into macro to allow user to choose multiple text entries
 
Join Date: Mar 2014
Posts: 21
Hoxton118 is on a distinguished road
Default

Many thanks. I've tried to insert the code as follows (and lots of other ways too) but cannot make it work. Please advise where I've made an error. Thanks.

Code:
Sub CopyParas()
'
' CopyParas Macro
'
Dim range As range
Dim TargetList, i As Long
TargetList = InputBox("Put list of terms to find here, separated by commas")
For i = 0 To UBound(Split(TargetList, ","))
  MsgBox Split(TargetList, ",")(i)
Next
For i = 0 To UBound(TargetList)
Selection.Find.ClearFormatting
With Selection.Find
.Text = TargetList(i)
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Do While Selection.Find.Execute
Selection.StartOf Unit:=wdParagraph
Selection.MoveEnd Unit:=wdParagraph
sBigString = sBigString + Selection.Text
Selection.MoveStart Unit:=wdParagraph
Loop
Next
Documents.Add DocumentType:=wdNewBlankDocument
Selection.InsertAfter (sBigString)
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert input box into macro to allow user to choose multiple text entries User input to a variable on the document dsm1995gst Word VBA 1 09-03-2013 03:43 PM
Insert input box into macro to allow user to choose multiple text entries Replacing text with user input.?.?.? brad1977 Word 3 11-20-2012 10:20 AM
Insert input box into macro to allow user to choose multiple text entries Restricting User Input on a TextBox (and setting focus) joatmon Excel Programming 1 06-05-2012 03:01 PM
Macro to Insert Text Into Cells Having Multiple Lines revans611 Excel Programming 4 10-24-2011 10:15 AM
Look up an array based on user input johnsmb Excel 2 01-07-2011 01:12 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:27 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft