With Sheets("工料")
If .[D6].End(xlDown).Row = .Rows.Count Then MsgBox "無資料": Exit Sub
For Each A In .Range(.[D6], .[D65536].End(xlUp)).SpecialCells(xlCellTypeConstants)
Ar = Split(A, "+")
For Each C In Ar
MyStr = C & "," & Left(A.Offset(, 3), 8) & "," & A.Offset(, 8)
dic1(MyStr) = Split(MyStr, ",")
Next
Next
End With作者: rouber590324 時間: 2015-2-11 08:31
DEAR SIR
加入如下試試
X = Application.WorksheetFunction.CountIf(Range("M1:M65536"), "WORK")
If X - 1 >= 0 Then
Private Sub Worksheet_Change(ByVal Target As Range)
n = Target.Row
If Target = Cells(n, "M") Or Cells(n, "M") = "work" Then
Cells(n, "N") = Application.Sum(Range("I" & n & ":K" & n))
Else
End
End If
End Sub
試試類似這方式看看是不是你想要的
這Sub,是只要改變儲存格就會去執行想要的動作作者: rouber590324 時間: 2015-2-11 14:01
With Sheets("工料")
If .[D6].End(xlDown).Row = .Rows.Count Then MsgBox "無資料": Exit Sub
X = Application.WorksheetFunction.CountIf(Range("M1:M65536"), "WORK")
If X - 1 >= 0 Then
For Each A In .Range(.[D6], .[D65536].End(xlUp)).SpecialCells(xlCellTypeConstants)
Ar = Split(A, "+")
For Each C In Ar
MyStr = C & "," & Left(A.Offset(, 3), 8) & "," & A.Offset(, 8)
dic1(MyStr) = Split(MyStr, ",")
Next
Next