½Ð°Ý VBA µ{¦¡n¦p¦ó×§ï ¡A¤~¯àÅý¼Ò½k±ø¥ó¤ñ¹ï§¹¾ã±ø¥ó¡A¨Ã§R°£¤£¥X²{¦bµ²ªG¤u§@ªí
- ©«¤l
- 228
- ¥DÃD
- 62
- ºëµØ
- 0
- ¿n¤À
- 364
- ÂI¦W
- 20
- §@·~¨t²Î
- Win 10
- ³nÅ骩¥»
- Office 2007 & 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-3-5
- ³Ì«áµn¿ý
- 2024-9-16
|
½Ð°Ý VBA µ{¦¡n¦p¦ó×§ï ¡A¤~¯àÅý¼Ò½k±ø¥ó¤ñ¹ï§¹¾ã±ø¥ó¡A¨Ã§R°£¤£¥X²{¦bµ²ªG¤u§@ªí
¥»©«³Ì«á¥Ñ jeffrey628litw ©ó 2019-12-18 16:03 ½s¿è
½Ð°Ý VBA µ{¦¡n¦p¦ó×§ï ¡A¤~¯àÅý¼Ò½k±ø¥ó¤ñ¹ï§¹¾ã±ø¥ó¡A¨Ã§R°£¤£¥X²{¦bµ²ªG¤u§@ªí
½Ð°Ý VBA Module11 µ{¦¡n¦p¦óקï¡A¤~¯àÅý¤u§@ªí "³]¤ñ¹ï±ø¥ó²M³æ" ¸Ì± HAKKO HLK1071
¯à¤ñ¹ï¤u§@ªí "¤ñ¹ï«á«½Æ²M³æ" DORMAN 761-5104¡þHAKKO HLK1071
µM«á HAKKO HLK1071²£¥Í¦bCÄæ¡A
¦b¨C¦¸¤ñ¹ï«á·s²£¥Íªº¤u§@ªí Sheet ®ø¥¢¡C
1.¿é¤JHAKKO HLK1071 ¦b AÄæ Partslink¸Ì±¡A
µM«á«ö¤U¥k¤Wµµ¦â«ö¶s ¬d¸ß[¥¼¤ñ¹ï¨ì]½s¸¹
2.¤ñ¹ï¤u§@ªí "¤ñ¹ï«á«½Æ²M³æ" DORMAN 761-5104¡þHAKKO HLK1071
µM«á HAKKO HLK1071²£¥Í¦bCÄæ
3.¦b¨C¦¸¤ñ¹ï«á·s²£¥Íªº¤u§@ªí Sheet ®ø¥¢¡C
ÀɮפU¸ü¡Ghttps://cht.tw/h/qvba0
Module11 µ{¦¡½X¡G
Sub ¶}©l¤ñ¹ï¤£«½Æ()
Dim t1
t1 = Timer '³o¬O²£¥Í¬í¼Æªº MSG
'==============================================================
Sheets("¤ñ¹ï«á«½Æ²M³æ").Select
ROW1 = Cells(Rows.Count, "C").End(3).Row
'¤U±3¦Cµ{¦¡¬O¦pªGn¼´¥X2Äæ¥H¤W¸ê®Æ»Ý¶}©ñªºµ{¦¡½X
' If ROW1 > 2 Then
' Range(Cells(1, "C"), Cells(ROW1, "E")).Clear
' End If
'==============================================================
ROW1 = Cells(Rows.Count, "A").End(3).Row
arr = Range("A2:A" & ROW1)
ROW2 = Sheets("³]¤ñ¹ï±ø¥ó²M³æ").Cells(Rows.Count, "A").End(3).Row
'¦pªGn¼´¥X2Äæ¥H¤W¸ê®Æ»Ý¶}©ñªºµ{¦¡½X¡A2Äæ Range("A1:A" & ROW2) n§ï¦¨ Range("A1:B" & ROW2)
Sheets("³]¤ñ¹ï±ø¥ó²M³æ").Range("A1:A" & ROW2).AdvancedFilter _
Action:=xlFilterCopy, CriteriaRange:=Range("A1:A" & ROW1), CopyToRange:=Range( _
"C1:C1"), Unique:=False
'¤W±ªº "C1:C1" ¬°±q¸ê®Æ®w¼´¥X¤ñ¹ï«á¸ê®Æ¡AÅã¥Ü¦b¦¹¤u§@ªí C1:C1
Columns("C:C").ColumnWidth = 28
Columns("D:D").ColumnWidth = 16
'==============================================================
'¥H¤U¬O¥Í¦¨ ¤£«½Æ¶µ¥Ø ªº¤u§@ªí
Sheets.Add After:=Sheets(Sheets.Count)
'Sheets(Sheets.Count).Name = "¥¼¤ñ¹ï¨ì²M³æ"
Columns("A:A").ColumnWidth = 28
Columns("B:B").ColumnWidth = 16
Cells(1, 3).Formula = "¡´ ¦¹¬O[¥¼¤ñ¹ï¨ì]²M³æ"
Cells(1, 3).Font.Color = RGB(43, 20, 134)
Cells(1, 3).Font.Bold = True
Cells(1, 6).Formula = "¡´ ¨Ï¥Î¹L«á¥i§R°£¦¹¤u§@ªí"
Cells(1, 6).Font.Color = RGB(128, 13, 32)
Cells(1, 6).Font.Bold = True
Sheets("³]¤ñ¹ï±ø¥ó²M³æ").Range("A1:A" & ROW2).Copy Range("A1")
For i = ROW2 To 2 Step -1
For j = 1 To UBound(arr)
If Cells(i, "A") Like arr(j, 1) Then
Rows(i).Delete
GoTo 1100
End If
Next
1100:
Next
'==============================================================
'¥H¤U¬°Åý²£¥Í ¤u§@ªí ¤£«½Æ¶µ¥Ø ªºA1Àx¦s®æ²£¥Í¦WºÙ
With Selection.Validation
.Delete
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop, Operator _
:=xlBetween
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.IMEMode = xlIMEModeNoControl
.ShowInput = True
.ShowError = True
End With
'==============================================================
'¥H¤U¬°Åã¥ÜVBA Runµ{¦¡ªº®É¶¡
MsgBox "§ì¸ê®Æ§¹¦¨! " & Chr(10) & "¨Ï¥Î®É¶¡¡G" & Round(Timer - t1, 2) & " ¬í" & Chr(10) & "¥¼¤ñ¹ï¨ìªº¸ê®Æ¡A¦@p¦³" & " " & Application.CountA(ActiveSheet.Columns("A:A")) - 1 & " " & "µ§"
'MsgBox "§ì¸ê®Æ§¹¦¨! " & Chr(10) & "¨Ï¥Î®É¶¡¡G" & Round(Timer - t1, 2) & " ¬í" ³o¬O²£¥Í¬í¼Æªº MSG
'==============================================================
End Sub |
|
|
|
|
|
|
- ©«¤l
- 228
- ¥DÃD
- 62
- ºëµØ
- 0
- ¿n¤À
- 364
- ÂI¦W
- 20
- §@·~¨t²Î
- Win 10
- ³nÅ骩¥»
- Office 2007 & 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-3-5
- ³Ì«áµn¿ý
- 2024-9-16
|
¦^´_ 1# jeffrey628litw
ª¦¤å¤w¸g§ä¨ì¤èªk¡A´£¨Ñµ¹¦U¦ì°Ñ¦Ò
Sub ¹LÂo³æ¤@Àx¦s®æÂù±ø¥ó«½Æ²M³æ()
Dim Ar(32)
Sheets("³]¤ñ¹ï±ø¥ó²M³æ").Select
Sheets("³]¤ñ¹ï±ø¥ó²M³æ").Name = "Sheet1"
Set d = CreateObject("Scripting.Dictionary")
With Sheet1
For Each a In .Range(.[A2], .[A101].End(xlUp))
For i = 0 To 1
Ar(i) = a.Offset(, i).Value
Next i
d(a & "") = Ar
Next
End With
Range("a1").Parent.Name = "³]¤ñ¹ï±ø¥ó²M³æ"
Sheets("¤ñ¹ï«á«½Æ²M³æ").Select
Sheets("¤ñ¹ï«á«½Æ²M³æ").Name = "Sheet2"
With Sheet2
For Each a In .Range(.[D2], .[D101].End(xlUp))
For Each ky In d.keys
If InStr(a, ky) > 0 Then a.Offset(, -3).Resize(, 1) = d(ky): Exit For
Next
Next
End With
Range("D2").Select
Selection.AutoFill Destination:=Range("D2:D101"), Type:=xlFillDefault
Range("D2:D101").Select
Range("D2").Select
Range("a1").Parent.Name = "¤ñ¹ï«á«½Æ²M³æ"
End Sub |
|
|
|
|
|
|
- ©«¤l
- 228
- ¥DÃD
- 62
- ºëµØ
- 0
- ¿n¤À
- 364
- ÂI¦W
- 20
- §@·~¨t²Î
- Win 10
- ³nÅ骩¥»
- Office 2007 & 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-3-5
- ³Ì«áµn¿ý
- 2024-9-16
|
§ó¥¿¤@¤U2.ªºµ²ªG
2.¤ñ¹ï¤u§@ªí "¤ñ¹ï«á«½Æ²M³æ" DORMAN 761-5104¡þHAKKO HLK1071
µM«á DORMAN 761-5104¡þHAKKO HLK1071
²£¥Í¦bCÄæ |
|
|
|
|
|
|