|
我想替换的是第6列的内容,但是其他列的也被替换了,还请高手指教啊,谢谢!
Sub 替换地点()
Dim x As Integer
For x = 1 To 500
If Cells(x, 6) = "住址" Then
Cells.Replace What:=Cells(x, 6), Replacement:="'001"
ElseIf Cells(x, 6) = "公司" Then
Cells.Replace What:=Cells(x, 6), Replacement:="'002"
ElseIf Cells(x, 6) = "户籍" Then
Cells.Replace What:=Cells(x, 6), Replacement:="'003"
ElseIf Cells(x, 6) = "手机" Then
Cells.Replace What:=Cells(x, 6), Replacement:="'004"
ElseIf Cells(x, 6) = "其他" Then
Cells.Replace What:=Cells(x, 6), Replacement:="'999"
End If
Next x
End Sub
Sub 替换地点()
Dim x As Integer
For x = 1 To 500
If Cells(x, 6) = "住址" Then
Cells(x, 6)="'001"
ElseIf Cells(x, 6) = "公司" Then
Cells(x, 6)="'002"
ElseIf Cells(x, 6) = "户籍" Then
Cells(x, 6)="'003"
ElseIf Cells(x, 6) = "手机" Then
Cells(x, 6)="'004"
ElseIf Cells(x, 6) = "其他" Then
Cells(x, 6)="'999"
End If
Next x
End Sub
|
|