Hi everyone, first post here.
So, I have this spreadsheet that needs to change the values
A B C D E F G
[TABLE="width: 512"]
<colgroup><col width="64" span="8" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64, align: right"]5[/TD]
[TD="width: 64"][/TD]
[TD="width: 64"]e[/TD]
[TD="width: 64"]e[/TD]
[TD="width: 64"]z[/TD]
[TD="width: 64"]z[/TD]
[TD="width: 64"]u[/TD]
[TD="width: 64"]u[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD][/TD]
[TD]e[/TD]
[TD]e[/TD]
[TD]z[/TD]
[TD]z[/TD]
[TD]u[/TD]
[TD]u[/TD]
[/TR]
[TR]
[TD="align: right"]20[/TD]
[TD][/TD]
[TD]e[/TD]
[TD]e[/TD]
[TD]z[/TD]
[TD]z[/TD]
[TD]u[/TD]
[TD]u[/TD]
[/TR]
[TR]
[TD="align: right"]30[/TD]
[TD][/TD]
[TD]e[/TD]
[TD]e[/TD]
[TD]z[/TD]
[TD]z[/TD]
[TD]u[/TD]
[TD]u[/TD]
[/TR]
[TR]
[TD="align: right"]40[/TD]
[TD][/TD]
[TD]e[/TD]
[TD]e[/TD]
[TD]z[/TD]
[TD]z[/TD]
[TD]u[/TD]
[TD]u[/TD]
[/TR]
[TR]
[TD="align: right"]50[/TD]
[TD][/TD]
[TD]e[/TD]
[TD]e[/TD]
[TD]z[/TD]
[TD]z[/TD]
[TD]u[/TD]
[TD]u[/TD]
[/TR]
</tbody>[/TABLE]
Well, every letter there needs to change to the referencial in the column A.
Right now, my code is this
"
Sub Macro1()'
' Macro1 Macro
'
'Line 2
Range("C2:H2").Select
Selection.Replace What:="e", Replacement:=Range("A2").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="z", Replacement:=Range("A2").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="u", Replacement:=Range("A2").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("J6").Select
End Sub
"
In the original sheet I have over 300 lines do format. All ranged E7:BQ7.
So, I need to make a LOOP, changing the range of selection and also my referencial.
Someone can help with this?
Sorry for my bad english.
Thank you!
So, I have this spreadsheet that needs to change the values
A B C D E F G
[TABLE="width: 512"]
<colgroup><col width="64" span="8" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64, align: right"]5[/TD]
[TD="width: 64"][/TD]
[TD="width: 64"]e[/TD]
[TD="width: 64"]e[/TD]
[TD="width: 64"]z[/TD]
[TD="width: 64"]z[/TD]
[TD="width: 64"]u[/TD]
[TD="width: 64"]u[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD][/TD]
[TD]e[/TD]
[TD]e[/TD]
[TD]z[/TD]
[TD]z[/TD]
[TD]u[/TD]
[TD]u[/TD]
[/TR]
[TR]
[TD="align: right"]20[/TD]
[TD][/TD]
[TD]e[/TD]
[TD]e[/TD]
[TD]z[/TD]
[TD]z[/TD]
[TD]u[/TD]
[TD]u[/TD]
[/TR]
[TR]
[TD="align: right"]30[/TD]
[TD][/TD]
[TD]e[/TD]
[TD]e[/TD]
[TD]z[/TD]
[TD]z[/TD]
[TD]u[/TD]
[TD]u[/TD]
[/TR]
[TR]
[TD="align: right"]40[/TD]
[TD][/TD]
[TD]e[/TD]
[TD]e[/TD]
[TD]z[/TD]
[TD]z[/TD]
[TD]u[/TD]
[TD]u[/TD]
[/TR]
[TR]
[TD="align: right"]50[/TD]
[TD][/TD]
[TD]e[/TD]
[TD]e[/TD]
[TD]z[/TD]
[TD]z[/TD]
[TD]u[/TD]
[TD]u[/TD]
[/TR]
</tbody>[/TABLE]
Well, every letter there needs to change to the referencial in the column A.
Right now, my code is this
"
Sub Macro1()'
' Macro1 Macro
'
'Line 2
Range("C2:H2").Select
Selection.Replace What:="e", Replacement:=Range("A2").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="z", Replacement:=Range("A2").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="u", Replacement:=Range("A2").Value, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("J6").Select
End Sub
"
In the original sheet I have over 300 lines do format. All ranged E7:BQ7.
So, I need to make a LOOP, changing the range of selection and also my referencial.
Someone can help with this?
Sorry for my bad english.
Thank you!