I need to access a text file and locate a word within the file. If the word exists, I need to replace it with a value that the user will type. Can you help me fix this code so that it works?
Sub Substituir()
arquivo = “C:Usersmaicon.caetanoDesktopTeste VBATexteVBA_1.mpf”
L1_comprimento = InputBox("Digite o Comprimento do Perfil:", "COMPRIMENTO")
Set myrange = arquivo.Content
myrange.Find.Execute findtext:="F2", replacewith:=L1_comprimento
End Sub
New contributor
Maicon Caetano is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.