我在if语句中有2个变量,我正在对其执行加法任务。但是第一个变量Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
Dim ws As Worksheet, iRow As Long, iCol As Long, Message As String, SheetId As String, iRowE As Long, iColE As Long, iRowB As Long, iColB As Long
Set ws = Sh
SheetId = Replace(ws.Name, " ", "")
SheetId = Left(SheetId, 2) & Right(SheetId, 2)
iRowB = Target.Row
iColB = Target.Column
iRowE = iRowB + Target.Rows.Count - 1
iColE = iColB + Target.Columns.Count - 1
Message = Format(Now(), "ddHHmmss") & Application.UserName & "-" & SheetId
For iRow = iRowB To iRowE
For iCol = iColB To iColE
Message = Message & "|" & Format(iRow, " 0") & Format(iCol, " 0") & "|" & CStr(ws.Cells(iRow, iCol).Text)
Next iCol
Next iRow
If Not FileExists("L:\HC\" & ThisWorkbook.Name & Format(Now(), "YYYYMM") & ".Log") Then
Call LogIt("L:\HC\" & ThisWorkbook.Name & Format(Now(), "YYYYMM") & ".Log", "ddHHmmssUSER-sheet|row col|value|row col|value")
End If
Call LogIt("L:\HC\" & ThisWorkbook.Name & Format(Now(), "YYYYMM") & ".Log", Message)
End Sub
工作正常,并且添加了所有值,但第二个变量sumOfWeightedIndicator
没有得到调用。因此我的sumOfIndicator
也没有接到电话。
retnull