Hi All,
I am new here and was hoping for some help I have some VB code that changes details across a who workbook I only want it to run on sheet1, can someone help me redesign to get this working. I have taken this list of names out of the fndlst as they are sensitive.
Sub test()
Dim sht As Variant
Dim fndlst As Variant
Dim rplclist As Variant
fndlst = Array("GB")
rplclist = Array("1", "2", "3", "4", "5", "6", "7", "8", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "")
For x = LBound(fndlst) To UBound(fndlst)
For Each sht In ActiveWorkbook.Worksheets
sht.Cells.Replace what:=fndlst(x), Replacement:=rplclist(x), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, _
SearchFormat:=False, ReplaceFormat:=False
Next sht
Next x
End Sub
I am new here and was hoping for some help I have some VB code that changes details across a who workbook I only want it to run on sheet1, can someone help me redesign to get this working. I have taken this list of names out of the fndlst as they are sensitive.
Sub test()
Dim sht As Variant
Dim fndlst As Variant
Dim rplclist As Variant
fndlst = Array("GB")
rplclist = Array("1", "2", "3", "4", "5", "6", "7", "8", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "")
For x = LBound(fndlst) To UBound(fndlst)
For Each sht In ActiveWorkbook.Worksheets
sht.Cells.Replace what:=fndlst(x), Replacement:=rplclist(x), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, _
SearchFormat:=False, ReplaceFormat:=False
Next sht
Next x
End Sub