|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2012-10-17 12:01
|
显示全部楼层
usstlf 发表于 2012-10-17 12:58 ![](static/image/common/back.gif)
宏的问题,发文件上来看看
Private Sub FinishedOptBtn_Click()
ActiveSheet.NextStepBtn.Enabled = False
ActiveSheet.NextStepBtn.BackColor = RGB(240, 240, 240)
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
Private Sub OngoingOptBtn_Click()
ActiveSheet.NextStepBtn.Enabled = True
ActiveSheet.NextStepBtn.BackColor = RGB(150, 255, 150)
ActiveSheet.Unprotect
Cells(1, 1).Activate
End Sub
Private Sub NextStepBtn_Click()
If Cells(7, 6).Value = "" Or Cells(8, 6).Value = "" Or Cells(9, 6).Value = "" Then
Exit Sub
End If
For c = 7 To ActiveSheet.UsedRange.Columns.Count + 1
If Cells(6, c).Value = "" Or Cells(7, c).Value = "" Or Cells(8, c).Value = "" _
Or Cells(9, c).Value = "" Then
lastcol = c - 1
Exit For
End If
Next c
lastrow = ActiveSheet.UsedRange.Rows.Count
ActiveSheet.Range(Cells(10, lastcol), Cells(lastrow, lastcol)).Select
Selection.Copy
ActiveSheet.Cells(10, lastcol + 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveSheet.Cells(2, lastcol + 1).Select
Application.CutCopyMode = False
ActiveSheet.NextStepBtn.Left = Cells(6, lastcol + 1).Left
End Sub |
|