|
提出几点建议:
1。可作为VBA入门用。
2。加密太过于简单(仅仅保护工程,破解太容易(5秒钟搞定))
3。唯一可以用作VBA学习的地方仅有一下代码
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Rows("1:1").RowHeight = 19.5
With Rows("1:1").Font
.Name = "宋体"
.Size = 12
.Bold = True
End With
Range(Cells(1, 1), Cells(1, a + 4)).Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.MergeCells = True
End With
[a1] = S
[a2] = "编号"
[b2] = "姓名"
For Q = 3 To a + 2
Cells(2, Q) = "评委" & Q - 2
Cells(2, Q + 1) = "最后得分"
Cells(2, Q + 2) = "排名"
Next
'各评委名称
aa = Chr(66 + a)
bb = Chr(67 + a)
'判断出列号
For i = 3 To b + 2
Cells(i, 1) = i - 2
QQW = "=(SUM(c" & i & ":" & aa & i & ")"
QQE = "min(c" & i & ":" & aa & i & ")"
QQF = "max(c" & i & ":" & aa & i & "))"
kk = "$" & bb & "$3" & ":" & "$" & bb & "$" & b + 2 & ")"
Cells(i, a + 3) = QQW & "-" & QQE & "-" & QQF & "/ " & a - 2
Cells(i, a + 3).NumberFormatLocal = "0.0"
Cells(i, a + 4) = "=rank(" & bb & i & "," & kk
Next
'将公式放在合适的单元格中
Unload Me
'关闭窗体
If aq = True Then
Sheets(1).[a1].CurrentRegion.Select
Application.Dialogs(xlDialogBorder).Show
End If
If AW = True Then
Sheets(1).[a1].CurrentRegion.Select
Selection.Borders(xlEdgeLeft).Weight = xlMedium
Selection.Borders(xlEdgeTop).Weight = xlMedium
Selection.Borders(xlEdgeBottom).Weight = xlMedium
Selection.Borders(xlEdgeRight).Weight = xlMedium
Selection.Borders(xlInsideVertical).Weight = xlThin
Selection.Borders(xlInsideHorizontal).Weight = xlThin
End If
Application.ScreenUpdating = True
End Sub
--------------------------------------- |
|