■各行の指定された値をその行の特定部に置換する

Sub rep_charge()
Range("b3").Select
lastrow = Range("b3").End(xlDown).Row
For i = 3 To lastrow
With Selection
cur_val = .Value
Range(.Offset(, 1), .Offset(, 6)).Select
Selection.Replace what:="n", replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace what:="y", replacement:=cur_val, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
ActiveCell.Offset(1, -1).Select
End With
Next i
End Sub