E
Elessvie
Hello, folks --
Is it possible to pass a font property to a procedure using a variable? In
the procedure snippet below, I use (or try to use) “fntAttrib†to hold a
value like “bold†or “italicâ€. I assume the data type must be String. Is
this wrong?
Here is relevant part of the procedure:
Sub SearchForTerm(ByVal fntAttrib As String)
<snip>
If .Found Then
With oRng
.Font.fntAttrib = True
<snip>
To call it, I am using a button in a UserForm with the code below, passing
"Underline" to replace "fnt.Attribute" above:
Private Sub cmdTestingOnly_Click()
SearchForTerm ("Underline")
End Sub
When trying to run it, the error message "Method or data member not found"
appears on this and .fntAttribute is highlighted.
If someone could set me straight on this, I’d be really grateful. If I
haven't given enough information, please let me know.
Thank you very much,
-Lynne
Is it possible to pass a font property to a procedure using a variable? In
the procedure snippet below, I use (or try to use) “fntAttrib†to hold a
value like “bold†or “italicâ€. I assume the data type must be String. Is
this wrong?
Here is relevant part of the procedure:
Sub SearchForTerm(ByVal fntAttrib As String)
<snip>
If .Found Then
With oRng
.Font.fntAttrib = True
<snip>
To call it, I am using a button in a UserForm with the code below, passing
"Underline" to replace "fnt.Attribute" above:
Private Sub cmdTestingOnly_Click()
SearchForTerm ("Underline")
End Sub
When trying to run it, the error message "Method or data member not found"
appears on this and .fntAttribute is highlighted.
If someone could set me straight on this, I’d be really grateful. If I
haven't given enough information, please let me know.
Thank you very much,
-Lynne