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
|