I want to execute Replace method on Range object. After so much trials, laconic errors from debugger, and reading documentation, I decided to ask for help.
Why do my Replace methods not work? What about those commented ones?
Sub Convert_Sheet()
Dim set_1 As Range
Set set_1 = ActiveSheet.Range("A3:AZ300")
'set_1.Replace(TextBoxSourceJobPrefix.Text, TextBoxTargetJobPrefix.Text, xlWhole, xlByRows, True, )
'Set set_1 = Replace(set_1.Value, UCase(TextBoxSourceNode.Text), UCase(TextBoxTargetNode.Text))
set_1.Replace What:=TextBoxSourceJobPrefix.Text, Replacement:=TextBoxTargetJobPrefix.Text, LookAt:=xlWhole, SearchOrder:=xlByRows, MatchCase:=True
set_1.Replace UCase(TextBoxSourceNode.Text), UCase(TextBoxTargetNode.Text)
set_1.Replace TextBoxSourceGroup.Text & "G", TextBoxTargetGroup.Text & "G"
set_1.Replace TextBoxSourceGroup.Text & "Z", TextBoxTargetGroup.Text & "Z"
set_1.Replace LCase(TextBoxSourceNode.Text), LCase(TextBoxTargetNode.Text)
set_1.Replace TextBoxSourceJobOwner.Text, TextBoxTargetJobOwner.Text
End Sub
Each time I get Object required error:
Even if I opaque with With:
With set_1
.Replace What:=TextBoxSourceJobPrefix.Text, Replacement:=TextBoxTargetJobPrefix.Text, MatchCase:=True
.Replace What:=TextBoxSourceJobPrefix.Text, Replacement:=TextBoxTargetJobPrefix.Text, LookAt:=xlWhole, SearchOrder:=xlByRows, MatchCase:=True
End With
Replace syntax (a method of Range object):
So there IS a function that doesn't need as first parameter the String to be replaced. But why do all my trials fail? Do I have to execute a command with all the parameters? I need only one - MatchCase.
Is there a way to replace characters in range in bulk mode? (not using Replace(text, toReplace, ReplaceWith) )
I already found those questions helpful, but I still get errors:


TextBoxSourceJobPrefix.TextandTextBoxTargetJobPrefix.Textwhen it crashes?Option Explicit?TextBoxSourceJobPrefix.TextandTextBoxTargetJobPrefix.Textboth return valid strings, check thatSet_1is still valid - in the Immediate window, type in?Set_1.Addressand ensure that it shows$A$3:$AZ$300.Option Explicit. TextBoxSourceJobPrefix is not initialized. Checking on ways to make it visible or initialized.