5 回答

TA貢獻(xiàn)1847條經(jīng)驗(yàn) 獲得超11個(gè)贊
1、
Function gs()
gs = ActiveSheet.Cells(ActiveCell.Row, 1) + ActiveSheet.Cells(ActiveCell.Row, 2) + ActiveSheet.Cells(ActiveCell.Row, 3)
End Function
在D列及其右邊列輸入 =gs()
2、
Function gs(a, b, c)
gs = a + b - c '把公式的計(jì)算過程寫到這里,輸入公式時(shí)只要傳入?yún)?shù)
End Function
在D1輸入 =gs(A1,B1,C1)
復(fù)制填充公式
3、
其實(shí)要實(shí)現(xiàn) 作表中在錄入數(shù)據(jù)后目標(biāo)單元格自動(dòng)計(jì)算,但不需要?jiǎng)e人看見目標(biāo)單元格中的公式
可用工作表保護(hù)配合單元格鎖定來解決

TA貢獻(xiàn)1856條經(jīng)驗(yàn) 獲得超5個(gè)贊
1、
Function gs()
gs = ActiveSheet.Cells(ActiveCell.Row, 1) + ActiveSheet.Cells(ActiveCell.Row, 2) + ActiveSheet.Cells(ActiveCell.Row, 3)
End Function
在D列及其右邊列輸入 =gs()
2、
Function gs(a, b, c)
gs = a + b - c '把公式的計(jì)算過程寫到這里,輸入公式時(shí)只要傳入?yún)?shù)
End Function
在D1輸入 =gs(A1,B1,C1)
復(fù)制填充公式
3、
其實(shí)要實(shí)現(xiàn) 作表中在錄入數(shù)據(jù)后目標(biāo)單元格自動(dòng)計(jì)算,但不需要?jiǎng)e人看見目標(biāo)單元格中的公式
可用工作表保護(hù)配合單元格鎖定來解決

TA貢獻(xiàn)1807條經(jīng)驗(yàn) 獲得超9個(gè)贊
Sub test()
Dim i, j As Integer
Dim a, b As String
For i = 1 To ActiveSheet.UsedRange.Rows.Count
If Range("A" & i) = 1 Then
b = Range("B" & i).Value
For j = 1 To ActiveSheet.UsedRange.Rows.Count
If Int(j / 1000) * 1000 = j Then Application.StatusBar = "A 列進(jìn)度:" & i & " " & "C列進(jìn)度:" & j
a = Range("C" & j).Value
If InStr(1, a, b) <> 0 Then
Range("C" & j).Value = ""
End If
DoEvents
End If
End Sub'狀態(tài)欄寫的有進(jìn)度

TA貢獻(xiàn)1780條經(jīng)驗(yàn) 獲得超1個(gè)贊
全數(shù)組,速度稍快些:
Sub test()
Dim arr, brr, i&, j&, m&, n&
m = Cells(Rows.Count, "b").End(xlUp).Row
n = Cells(Rows.Count, "c").End(xlUp).Row
arr = Range("A1:B" & m)
brr = Range("C1:C" & n)
For i = 1 To n
For j = 1 To m
If arr(j, 1) = 1 Then
If InStr(brr(i, 1), arr(j, 2)) > 0 Then
brr(i, 1) = ""
Exit For
End If
End If
Next
Next
Cells(1, "c").Resize(n, 1) = brr
MsgBox "OK!"
End Sub
添加回答
舉報(bào)