![]() |
#31
|
|||
|
|||
![]()
Ok! It works! I am passing a variable in a Sub like this:
CallingSub 'This part clears the clipboard Dim clipboard As MSForms.DataObject Set clipboard = New MSForms.DataObject clipboard.SetText "" clipboard.PutInClipboard If InStr(StrTxt4, "FSA") > 0 Then Call FSA(clipboard) And the called sub looks like this: Sub FSA(clipboard) ' ' FSA Macro Dim StrTxt9 As String StrTxt9 = ActiveDocument.Paragraphs(9).Range.Text .....more code.... End sub And my question is this. Best Practices say to use a Function rather than a called sub? Is that right? Ok, but whyis a Function best? I don't get it. For development purposes, I got it going just calling a sub. Thanks |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
seyzna | Word | 7 | 05-22-2023 10:57 AM |
![]() |
wblock@cnu.edu | Word | 4 | 08-23-2017 06:11 PM |
![]() |
mssodium1219 | Word | 3 | 04-01-2015 04:24 AM |
![]() |
paulkaye | Word | 4 | 12-06-2011 11:05 PM |
Word 2003 cuts the last line of my document off | wordboy9317 | Word | 0 | 10-12-2009 08:44 AM |