- 在线时间
- 6599 小时
- 最后登录
- 2024-10-29
- 阅读权限
- 130
- 积分
- 7672
- UID
- 46936
- 注册时间
- 2005-8-26
- 帖子
- 5840
- 精华
- 3
|
Dim columna As Integer
Dim i As Integer
Dim n As Integer
Sheets("Sheet1").Select
columna = 3
For i = 3 To 100
If Cells(4, i) = Empty Then Exit For
columna = i
Next
Range(Cells(4, 3), Cells(19, columna)).Select
Selection.Copy
Range("C23").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("C42").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range(Cells(4, 3), Cells(4, columna)).Select
Selection.Copy
Range("C23").Select
ActiveSheet.Paste
Range("C42").Select
ActiveSheet.Paste
Sheets("Sheet2").Select
Cells.Select
Application.CutCopyMode = False
Selection.ClearContents
Sheets("Sheet1").Select
Range(Cells(5, 3), Cells(19, columna)).Select
Selection.Copy
Sheets("Sheet2").Select
Range("a1").Select
ActiveSheet.Paste
For n = 1 To 100
Sheets("Sheet2").Select
If Cells(1, 1) = Empty Then Exit For
Columns("A:A").Select
Application.CutCopyMode = False
Selection.TextToColumns Destination:=Range(Cells(1, columna + 1), Cells(1, columna + 1)), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="-", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
Sheets("Sheet2").Select
Range(Cells(1, columna + 1), Cells(15, columna + 1)).Select
Selection.Copy
Sheets("Sheet1").Select
Cells(24, 2 + n).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet2").Select
Range(Cells(1, columna + 2), Cells(15, columna + 2)).Select
Selection.Copy
Sheets("Sheet1").Select
Cells(43, 2 + n).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet2").Select
Range(Cells(1, columna + 1), Cells(15, columna + 2)).Select
Selection.ClearContents
Columns("a:a").Select
Selection.Delete Shift:=xlToLeft
Next
Sheets("Sheet1").Select
Cells(24, columna + 1).Select
ActiveCell.FormulaR1C1 = "=ROUND(AVERAGE(RC3:RC[-1]),2)"
Cells(24, columna + 1).Select
Selection.AutoFill Destination:=Range(Cells(24, columna + 1), Cells(38, columna + 1)), Type:=xlFillDefault
Cells(24, columna + 1).Select
ActiveWindow.SmallScroll Down:=15
Cells(43, columna + 1).Select
ActiveCell.FormulaR1C1 = "=ROUND(AVERAGE(RC3:RC[-1]),2)"
Cells(43, columna + 1).Select
Selection.AutoFill Destination:=Range(Cells(43, columna + 1), Cells(57, columna + 1)), Type:=xlFillDefault
Cells(43, columna + 1).Select
ActiveWindow.SmallScroll Down:=15
Cells(27, columna + 2).Select
ActiveCell.FormulaR1C1 = "=ROUND(AVERAGE(RC3:RC[-2])/351.75*100,2)"
Cells(30, columna + 2).Select
ActiveCell.FormulaR1C1 = "=ROUND(AVERAGE(RC3:RC[-2])/335.33*100,2)"
Cells(36, columna + 2).Select
ActiveCell.FormulaR1C1 = "=ROUND(AVERAGE(RC3:RC[-2])/337.25*100,2)"
Cells(46, columna + 2).Select
ActiveCell.FormulaR1C1 = "=ROUND(AVERAGE(RC3:RC[-2])/351.75*100,2)"
Cells(49, columna + 2).Select
ActiveCell.FormulaR1C1 = "=ROUND(AVERAGE(RC3:RC[-2])/335.33*100,2)"
Cells(55, columna + 2).Select
ActiveCell.FormulaR1C1 = "=ROUND(AVERAGE(RC3:RC[-2])/337.25*100,2)"
End Sub |
|