Home > Software engineering >  How can I strictly to replace/vba
How can I strictly to replace/vba

Time:11-10

Code such as:
Sub tihuan ()
With activesheet. Usedrange. Cells
. Replace "zhang", "test"
End with
End sub

If there is a personal name: zhang SAN 9, then will be replaced by: test9
How can I solve this problem?

CodePudding user response:

If aaaa="zhang SAN" then BBBB="test9"

CodePudding user response:

 Sub tihuan () 
With ActiveSheet. UsedRange. Cells
. Replace "zhang", "test", LookAt:=1
End With
End Sub
  •  Tags:  
  • VBA
  • Related