資料量大的計算
各位先進好a-i欄位是原始資料
希望在L1和M1儲存格輸入資料篩選條件
只要A-I欄位內容非空白就進行篩選
而將篩選結果顯示在N-P欄位
最後再排版,在V-X欄位將資料由第2列往下排 [quote]各位先進好
a-i欄位是原始資料
希望在L1和M1儲存格輸入資料篩選條件
只要A-I欄位內容非空白就進行篩選
...
[size=2][color=#999999]oak0723-1 發表於 2022-5-4 21:33[/color] [url=http://forum.twbts.com/redirect.php?goto=findpost&pid=118755&ptid=23650][img]http://forum.twbts.com/images/common/back.gif[/img][/url][/size][/quote]
請測試看看,謝謝
Sub test()
Dim Arr, Brr(), T$, T1$, n&, R&, i&
Arr = Range("a1").CurrentRegion
ReDim Brr(1 To UBound(Arr), 1 To 3)
T = [L1] & "|" & [M1]
For i = 2 To UBound(Arr)
T1 = Arr(i, 3) & "|" & Arr(i, 2)
If T = T1 Then
n = n + 1: If n = 1 Then R = i
Brr(n, 1) = Application.Text(Arr(i, 4), "00\:00\:00")
Brr(n, 2) = Arr(i, 5): Brr(n, 3) = Arr(i, 6)
End If
Next
If n > 0 Then
[v1].CurrentRegion.Offset(1).ClearContents
Range("n2:p" & UBound(Arr)).ClearContents
Range("n" & R).Resize(n, 3) = Brr
Range("v2").Resize(n, 3) = Brr
End If
End Sub Sub 按鈕1_Click()
X = 工作表1.[A65536].End(xlUp).Row
Y = 2
MP1 = Range("L1")
MP2 = Range("M1")
For i = 1 To X
If 工作表1.Cells(i, 3) = MP1 And 工作表1.Cells(i, 2) = MP2 Then
Cells(Y, 14) = Application.Text(工作表1.Cells(i, 4).Value, "00\:00\:00")
Cells(Y, 15).Resize(, 2).Value = 工作表1.Cells(i, 5).Resize(, 2).Value
Y = Y + 1
End If
Next
End Sub
剛在學習,一起研究. [url]https://blog.xuite.net/hcm19522/twblog/590369899[/url] [b]回復 [url=http://forum.twbts.com/redirect.php?goto=findpost&pid=118757&ptid=23650]2#[/url] [i]samwang[/i] [/b]
有點問題,_ [b]回復 [url=http://forum.twbts.com/redirect.php?goto=findpost&pid=118761&ptid=23650]3#[/url] [i]dou10801[/i] [/b]
執行結果有問題
因為版本問題嗎 [quote]回復 samwang
有點問題,_
[size=2][color=#999999]oak0723-1 發表於 2022-5-5 20:44[/color] [url=http://forum.twbts.com/redirect.php?goto=findpost&pid=118768&ptid=23650][img]http://forum.twbts.com/images/common/back.gif[/img][/url][/size][/quote]
[color=Blue]需求欄位不一樣,修改改如下[color=Red]紅字[/color]即可,謝謝[/color]
T1 = Arr(i, [color=Red][b]1[/b][/color]) & "|" & Arr(i, 2) [color=Red] '新的需求[/color] [i=s] 本帖最後由 dou10801 於 2022-5-6 08:49 編輯 [/i]
[b]回復 [url=http://forum.twbts.com/redirect.php?goto=findpost&pid=118769&ptid=23650]6#[/url] [i]oak0723-1[/i] [/b]
If 工作表1.Cells(i, 3) = MP1 And 工作表1.Cells(i, 2) = MP2 Then .
改 If 工作表1.Cells(i, 1) = MP1 And 工作表1.Cells(i, 2) = MP2 Then [b]回復 [url=http://forum.twbts.com/redirect.php?goto=findpost&pid=118773&ptid=23650]8#[/url] [i]dou10801[/i] [/b]
感恩感恩
我還以為是版本問題 [b]回復 [url=http://forum.twbts.com/redirect.php?goto=findpost&pid=118772&ptid=23650]7#[/url] [i]samwang[/i] [/b]
感恩感恩
頁:
[1]