- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 10# luke
°õ¦æ [¼g¤JWork]«e¶·¥ý°õ¦æ [Link] ½T©w¤u§@ªíªº¶W³sµ².- Sub Link()
- Dim D As Object, R As Integer, C As Range, A As Range, Ky As Variant
- Set D = CreateObject("Scripting.Dictionary")
- With Sheets("sheet1")
- Set A = .[A:A].Find([J1], lookat:=xlWhole)
- If [J1] = "" Then Exit Sub
- For Each C In .Range(A, .[A65536].End(xlUp))
- If C & C.Offset(, 1) Like .[I3] & .[J3] Then
- D(C.Value & D.Count) = C.Resize(, 2).Address(0, 0)
- End If
- Next
- [L:N].Clear
- If D.Count = 0 Then MsgBox "µL²Å¦X¸ê®Æ": Exit Sub
- For Each Ky In D.keys
- R = R + 1
- .Cells(R, "L") = .Range(D(Ky)).Cells(1, 1)
- .Cells(R, "M") = .Range(D(Ky)).Cells(1, 2)
- .Hyperlinks.Add Anchor:=.Cells(R, "N"), Address:="", SubAddress:=D(Ky)
- Next
- End With
- Range("J3").Select
- End Sub
- Sub ¼g¤JWork()
- Dim Rng(1 To 3) As Range, E As Variant, R As Range
- Set Rng(1) = Sheets("Work").UsedRange.Range("a:a")
- For Each E In Sheets("Sheet1").Hyperlinks 'ª«¥ó¶°¦X:¤u§@ªíªº¶W³sµ²¡C
- Set Rng(2) = Sheets("Sheet1").Range(E.SubAddress) '¨î©w: ¶W³sµ²ªºÀx¦s®æ
- For Each R In Rng(1)
- If Rng(2).Cells(1) & Rng(2).Cells(1, 2) = R & R.Cells(1, 2) Then '»P¶W³sµ²Àx¦s®æªº¤º®e¬Û¦P
- Set Rng(3) = R.CurrentRegion '½d³ò¥u¦³AB¨âÄæ
- 'CurrentRegion ÄÝ©Ê ¶Ç¦^ Range ª«¥ó¡A¸Óª«¥ó¥Nªí¥Ø«eªº°Ï°ì¡C¥Ø«e°Ï°ì¬O«ü¥H¥ô·NªÅ¥Õ¦C¤ÎªÅ¥ÕÄ檺²Õ¦X¬°Ãä¬Éªº½d³ò¡C°ßŪ¡C
- Rng(2).CurrentRegion.Copy '½Æ»s:¶W³sµ²Àx¦s®æªº³sÄò½d³ò
- Rng(3)(1).Insert Shift:=xlDown '´¡¤J¶K¤W:¶W³sµ²Àx¦s®æªº³sÄò½d³ò
- 'Rng(3)(1) => Rng(3).Cells(1, 1) '½d³òªº²Ä¤@Ó·¡åJ®æ
- Set Rng(3) = Rng(3).Range("A1:C" & Rng(3).Rows.Count) '¦h¼W¥[¤@Äæ«O«ù¸ê®Æªº§¹¾ã©Ê (CÄæ¤]n§R°£)
- Rng(3).Delete Shift:=xlUp '§R°£: ¤U¤èÀx¦s®æ¤W²¾
- Exit For
- End If
- Next
- Next
- Set Rng(1) = Sheets("Sheet1").[A:A].Find("END", lookat:=xlWhole) '[SHEET1]AÄ椤´M§ä: "END"
- Set Rng(1) = Sheets("Sheet1").Range("A1:C" & Rng(1).Row) '¨î©w½d³ò: AÄæ¨ìCÄæ "END"ªº¦C¸¹
- Rng(1).Copy Sheets("Work").Cells(Sheets("Work").Rows.Count, 1).End(xlUp)
- MsgBox "§¹¦¨"
- End Sub
½Æ»s¥N½X |
|