-
Find Replace from external file
some more try
i am zero in VBA.Pls help
[VBA]
Sub testing()
Dim fnd As String
Dim rpl As String
fnd = Array("1783", "1790", "1801", "1807", "1856", "1857", "1864", "1874", "1888", _
"1897", "1898", "KA82", "KB75", "KB76", "KB84", "SB01", "SB02", "SB03", "SB04", "SB05", _
"SB06", "SB07", "SB08", "SB09", "SB10", "SB11", "SB12", "SB13", "SB14", "SB15", "SB16", "SB18", _
"SB19", "SB21", "SB22", "SB23", "SB24", "SB25", "SB26", "SB27", "SB28", "SB29", "SB30", "SB33", _
"SB34", "SB35", "SB36", "SB37", "SB38", "SB39", "SB43", "SB44")
rpl = Array("Satish Kumar", "Selvakumar", "Chetan Jadhav", "Sudhir Hase", "Mushtaq", _
"Pradeep Kumar", "Deepak DV", "Rajkumar", "Prashanth", "Lokesh", "Harish", "NKS", _
"Mys TC", "Hubli", "Arun SME", "Sudhir Hase", "Mushtaq", "Satish Kumar", "Mushtaq", _
"Satish Kumar", "Sudhir Hase", "Rajkumar", "Prashant M", "SelvaKumar", "SelvaKumar", _
"Prashant M", "Selvakumar", "Rajkumar", "Sudhir Hase", "Prashant M", "Chetan Jadhav", _
"Chetan Jadhav", "Chetan Jadhav", "Pradeep Kumar", "Satish TC Mys", "Chetan Jadhav", _
"SelvaKumar", "Sudhir Hase", "Sudhir Hase", "Spandana Systems", "NK Services", "Satish TC Mys", _
"Pradeep Kumar", "Sudhir Hase", "Chetan Jadhav", "Rajkumar", "Chetan Jadhav", "Chetan Jadhav", _
"Satish TC Mys", "Rajkumar", "Prashant M", "Satish TC Mys")
For i = 1 To UBound(fnd)
Selection.Replace what:=fnd, replacement:=rpl, lookat:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Next i
End Sub
Sub another()
ChDir "C:\Data_Analysis"
Workbooks.Open Filename:="C:\Data_Analysis\Reference Table.xls", Origin:= _
xlWindows
Windows("sample.xls").Activate
selection.replace what:=worksheets("sheet1").range("a2"),replacement:=workbooks("sample.xls") .Worksheets("engr map").range("B2), _
lookat:=xlpart, searchorder:=xlbyrows, matchcase:=false, searchformat:=false,replaceformat:=false
End Sub
[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules