[attach]13046[/attach]
Option Explicit
Sub check()
Dim K As String, M As Boolean, xRow As Integer, xi As Integer
With ActiveSheet.Shapes(Application.Caller)
With .TextFrame
K = .Characters.Text
If Left(K, 1) = "■" Then
.Characters.Text = "□加工一"
M = False
Else
.Characters.Text = "■加工一"
M = True
End If
.Characters(1, Len(K) + 1).Font.Size = 10
.Characters(1, 1).Font.Size = 10
End With
.TopLeftCell.Offset(, 1) = M
.TopLeftCell.Offset(, 2) = IIf(CSng(M) = 0, 0, 1)
End With
Sheet2.UsedRange("L13:S27").ClearContents
xRow = 25
With ActiveSheet
Do While .Cells(xRow, "C") <> ""
If .Cells(xRow, "C") = 1 Then
xi = xi + 1
Sheet2.Rows(1).Copy Sheet2.Cells(Rows.Count, "A").End(xlUp).Offset(1)
With Sheet2.Cells(Rows.Count, "A").End(xlUp)
.Cells(1) = xi
.Cells(12, 14) = ActiveSheet.Cells(xRow, "F")
.Cells(12, 17) = ActiveSheet.Cells(xRow, "H")
.Cells(12, 18) = ActiveSheet.Cells(xRow, "J")
.Cells(12, 19) = ActiveSheet.Cells(xRow, "K")
End With
End If
xRow = xRow + 1
Loop
End With
End Sub
[attach]13047[/attach]作者: mark15jill 時間: 2012-11-6 15:30