ChDir "D:\InTouch_QCProj\111" 改变目录 Workbooks.Open Filename:="D:\InTouch_111\QICHUN\HISTDATA.CSV" ActiveWindow.SmallScroll Down:=-18 Range("A2").Select Selection.Copy Windows("报表模板.xls").Activate ActiveWindow.SmallScroll Down:=-12 Range("B3:C3").Select ActiveSheet.Paste Windows("HISTDATA.CSV").Activate Range("C2:E25").Select Application.CutCopyMode = False Selection.Copy Windows("报表模板.xls").Activate Range("B7:D30").Select ActiveWindow.SmallScroll Down:=-6 ActiveSheet.Paste Windows("HISTDATA.CSV").Activate Range("F2:K25").Select Application.CutCopyMode = False Selection.Copy Windows("报表模板.xls").Activate Range("E7:J30").Select ActiveWindow.SmallScroll Down:=-6 ActiveSheet.Paste Range("B7:D30").Select ActiveWindow.SmallScroll Down:=-3 Application.CutCopyMode = False Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlInsideVertical) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlInsideHorizontal) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With Range("E7:J30").Select Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlInsideVertical) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlInsideHorizontal) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With Windows("HISTDATA.CSV").Activate ActiveWindow.Close ActiveWindow.ScrollColumn = 2 ActiveWindow.ScrollColumn = 1 Windows("报表模板.xls").Activate ThisWorkbook.StartTimer1 End Sub |