日期:2014-05-17 浏览次数:21025 次
Excel.Workbooks wbs = Aexcel.Workbooks; Excel.Workbook wb = wbs[1]; Excel.Worksheet ws = null; ws = (Excel.Worksheet)wb.Worksheets[str];//str是表单Sheet1 Excel.Range column1 = ws.get_Range(ws.Cells[1,1] as Excel.Range,ws.Cells[ws.Rows.Count,1] as Excel.Range);//A列 Excel.Range column2 = ws.get_Range(ws.Cells[1, 2] as Excel.Range, ws.Cells[ws.Rows.Count, 2] as Excel.Range);B列 Excel.Range column = ws.get_Range(ws.Cells[1,5] as Excel.Range,ws.Cells[ws.Rows.Count,5]as Excel.Range);//C列 column=column1; column1 = column2; column2 = column; wb.Save();