For Each dr As DataRow In DataTables("表A").Select("[组别] Is Not Null") dr("组别") = dr("组别").SubString(dr("组别").LastIndexOf("村")+1) dr("村名") = dr("村名").SubString(dr("村名").LastIndexOf("乡")+1).Replace(dr("组别"),Nothing) dr("乡名") = dr("乡名").Replace(dr("村名") & dr("组别"),Nothing).Replace("乡",Nothing) Next