ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] vlookup³t«×ºC¡A¨Ï¥Îvba¨ú¥Nªºµ{¦¡½X

¦^´_ 15# Qin
¢°¡^¦Û°Ê¨ú¹ïÀ³­È
Private Sub Worksheet_Change(ByVal Target As Range)
Dim xR As Range, xF As Range
With Target
     If .Columns.Count > 1 Or .Column <> 1 Then Exit Sub
     For Each xR In .Cells
         If .Row = 1 Then GoTo 101
         xR(1, 2).Resize(1, 2).ClearContents
         If xR = "" Then GoTo 101
         Set xF = [Sheet1!A:A].Find(xR, LookAt:=xlWhole, MatchCase:=False)
         If xF Is Nothing Then GoTo 101
         xR(1, 2).Resize(1, 2) = xF(1, 2).Resize(1, 2).Value
101: Next
End With
End Sub

¥i¥H¥u¹ïAÄæ³æ¤@Àx¦s®æ¿é¤J¨ú¹ïÀ³­È, ©Î¤@¦¸¶K¤J¦h­Ó¬d¸ß­È¨ú¹ïÀ³~~
¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð
¢±¡^¦r¨åªk¤ñ¹ï¨ú­È
¥u­n§ï¨â­Ó¡]¥[Ucase, ©ÎLcase, ±N­^¤å¦r±j¨îÂର¤j¼g©Î¤p¼g¡^
xD(UCase(Arr(i, 1))) = i
R = Val(xD(UCase(Brr(i, 1))))
¡@
¡@
¡@

TOP

¦^´_ 13# ­ã´£³¡ªL

­ã¤j
§Ú¤S¹J¨ì°ÝÃD¤F...
2­Óµ{¦¡½X, ·Q±N¥¦­×§ï¦¨:
1) ¤£½×¬O¿é¤J¤j¼g©Î¤p¼g³£¥i¥H§ì¨ì¸ê®Æ
2)±j¨îPart No. ¤@©w­n§¹¾ã¿é¤J, ¤~·|§ì¨ì¸ê®Æ
3) ¦pªG"A" Äæ¬Y­Ó³æ¤¸®æ¿é¤J¿ù»~, §R°£«á, B & C Äæ³æ¤¸®æ¨½ªº¸ê®Æ¤]­n¤@°_"²M°£"

Test1.rar (16.47 KB)

TOP

¦^´_ 6# Qin

¤£ºC£«,win 10 ,2010 ¤U ´ú¸Õ¥u»Ý9-10¬í.
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 12# Qin

Sub Ex_01()
Dim xD, Arr, Brr, xA As Range, xS As Worksheet, R&, C%, i&, j%
Set xD = CreateObject("scripting.dictionary")
R = [Search!A1].Cells(Rows.Count, 1).End(3).Row
Arr = [Search!A1:O1].Resize(R)
For i = 2 To UBound(Arr, 2):   xD(Arr(1, i) & "") = i - 1:   Next '¼Ð°O[Äæ]¦ì¸m
For i = 2 To UBound(Arr):   xD(Arr(i, 1) & "") = i - 1:   Next  '¼Ð°O[¦C]¦ì¸m
Set xA = [Search!B2:O2].Resize(R - 1)  '¸ê®Æ¶ñ¤J°Ï(§Y­ì¤½¦¡°Ï)
xA = "No Data"  '¹w¥ý¶ñ¤J[No Data], «Ý¦³²Å¦X¦AÂл\
Arr = xA.Value  '±a¤JArray

For Each xS In Sheets(Array("AB", "CD", "EF", "GH", "KL", "MN"))
    Brr = xS.UsedRange
    For i = 2 To UBound(Brr)
        R = Val(xD(Brr(i, 1) & "")): If R = 0 Then GoTo 101
    For j = 2 To UBound(Brr, 2)
        C = Val(xD(xS.Name & "_" & Brr(1, j)))
        If C > 0 Then Arr(R, C) = Brr(i, j)
    Next j
101: Next i
Next
xA.Value = Arr
End Sub

Dictionary_01v.rar (17.7 KB)

TOP

¦^´_ 9# ­ã´£³¡ªL

­ã¤j
¦]¬°¤£À´±o®M¥Î, ©Ò¥H¥Î¤½¦¡°µ¤F¤@­Ó½d¨Ò
¥i¥H½Ð§A§â¥¦¼g¦¨VBA¶Ü?

¸ê®Æ¦@¦³6­¶, ¨C¤@­¶³Ì¤Öªº¸ê®Æ¦³5¸Uµ§, ³Ì¦hªº¦³7¸Uµ§

Dictionary_01.rar (17.94 KB)

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2018-11-5 01:57 ½s¿è

¦^´_ 10# n7822123

´£¨Ñ¥ÎFind¨Ó¬d§äªº¤èªk¡A¤£¹L¨S¦³¦r¨åª«¥ó¨Óªº§Ö(³æ¯Â¥Î¨Ó´ú¸Õ)

Sub test_3()
Dim R%, T1
T1 = Timer
Application.ScreenUpdating = False
Sheets("Search").Activate  '­Y«ö¶s¦b"Search"­¶­±¥i¬Ù²¤¦¹¦Cµ{¦¡
For R = 2 To [A1].End(4).Row
    On Error Resume Next
      Cells(R, 2).Resize(, 3) = [data!A:A].Find(Cells(R, 1), lookat:=xlWhole).Offset(, 1).Resize(, 3).Value
      If Err = 91 Then Cells(R, 2).Resize(, 3) = "No Data"   '§ä¤£¨ì·|²£¥Í¿ù»~½X:91
    On Error GoTo 0
Next R
MsgBox "¦@¯Ó®É" & Round(Timer - T1, 2) & "¬í"
End Sub
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2018-11-5 01:32 ½s¿è

¦^´_ 9# ­ã´£³¡ªL


­ì¨Ó§âÀx¦s®æ¸ê®Æ©ñ¨ì¼Æ²Õ°}¦C«á¡A¦A¸Ë¨ì¦r¨å¸Ì­±
·|¤ñª½±µ®³Àx¦s®æªº­È©ñ¤J¦r¨å¸Ì­±¨Óªº§Ö!!
³o¦³ÂI¹H¤Ïª½Ä±...........

¥H¤U¬O§Ú®³·Ç¤jªºµ{¦¡½X°µ¤@¨Ç­×§ï¨Ó°µ¤ñ¸û
©úÅãtest_1 ¤ñ¸û§Ö

Sub test_1()
Dim T1, d, R%, Arr
T1 = Timer
Set d = CreateObject("scripting.dictionary")
Arr = Range([data!A1], [data!D1].End(4))
For R = 2 To UBound(Arr)
  d(Arr(R, 1) & "") = R
Next R
MsgBox "¦@¯Ó®É" & Round(Timer - T1, 2) & "¬í"
End Sub

Sub test_2()
Dim T1, d, R%
T1 = Timer
Set d = CreateObject("scripting.dictionary")
Sheets("data").Activate
For R = 2 To [A1].End(4).Row
  d(Cells(R, 1) & "") = R
Next R
MsgBox "¦@¯Ó®É" & Round(Timer - T1, 2) & "¬í"
End Sub
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

Sub Ex_01()
Dim xD, Arr, Brr, i&, j%, R&, Tm
Tm = Time
Set xD = CreateObject("scripting.dictionary")
Arr = Range([Data!D1], [Data!A1].Cells(Rows.Count, 1).End(3))
For i = 2 To UBound(Arr): xD(Arr(i, 1) & "") = i: Next
   
Brr = Range([Search!D1], [Search!A1].Cells(Rows.Count, 1).End(3))
For i = 2 To UBound(Brr)
    R = Val(xD(Brr(i, 1) & ""))
    For j = 1 To 3
        Brr(i - 1, j) = "No Data"
        If R > 0 Then Brr(i - 1, j) = Arr(R, j + 1)
    Next j
Next i

[Search!B2:D2].Resize(UBound(Brr) - 1) = Brr
MsgBox Time - Tm
End Sub

TOP

E As Range
For Each E In .Range(.[a1], .[a1].End(xlDown))

next

³o¬q§ï¦¨Array·|¦A¥[§Ö³t«×~~

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2018-11-4 03:54 ½s¿è

¦^´_ 6# Qin


¦r¨åª«¥óªºKey ¦pªG¿é¤Jªº¬O "¦r¦ê"¡A·|¥[§Ö³t«×
³o©Û·Ç¤j¤w¸g¥Î¹L¤£¤Ö¦¸¡A¦hª¦¤å´Nª¾¹D¤F
¬Ýªº¦³ÂIµh­W¡AÀ°§AÁY±Æ¤F

Option Explicit
Sub Ex()
Dim d As Object, E As Range, Ar(), T As Date
T = Time
Debug.Print "³Ìʽ¿ªÊ¼Ê±¼ä : " & T
Dim i As Long
Set d = CreateObject("scripting.dictionary")
With Sheets("Data")
  For Each E In .Range(.[a1], .[a1].End(xlDown))
    d(E.Value & "") = Array(E.Offset(, 1), E.Offset(, 2), E.Offset(, 3))
  Next
End With
   
With Sheets("Search").Range(Sheets("Search").[a2], Sheets("Search").[a2].End(xlDown)).Resize(, 4)
  Ar = .Value
  For i = 1 To UBound(Ar)
     If d.exists(Ar(i, 1)) Then
      Ar(i, 2) = d(Ar(i, 1) & "")(0)
      Ar(i, 3) = d(Ar(i, 1) & "")(1)
      Ar(i, 4) = d(Ar(i, 1) & "")(2)
    Else
      Ar(i, 2) = "No Data"
      Ar(i, 3) = "No Data"
      Ar(i, 4) = "No Data"
    End If
  Next
  .Value = Ar
End With

Debug.Print "³Ìʽ½áÊøʱ¼ä : " & Time, Application.Text(Time - T, "¹²¼Æ[S]Ãë")
End Sub

Dictionary.rar (834.78 KB)
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

        ÀR«ä¦Û¦b : ¡i¬O§_µo´§¤F¨}¯à¡H¡j¤H¶¡¹Ø©R¦]¬°µu¼È¡A¤~§óÅã±o¬Ã¶Q¡CÃø±o¨Ó¤@½ë¤H¶¡¡AÀ³°Ý¬O§_¬°¤H¶¡µo´§¤F¦Û¤vªº¨}¯à¡A¦Ó¤£­n¤@¨ý¨Dªø¹Ø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD