返回列表 上一主題 發帖

[發問] 如何依名稱作為搜尋條件,將所有符合資料一併秀出在註解(修改)

回復 2# starry1314
  1. Option Explicit
  2. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
  3.     Dim xF As Range, St As String
  4.     With Target.Item(1)
  5.         If .Column <> 3 Then Exit Sub
  6.         Cancel = True
  7.         .ClearComments
  8.         Set xF = Sheets("菜單(勿動)").[B:B].Find(.Value, Lookat:=xlWhole)
  9.         If Not xF Is Nothing Then
  10.             .NoteText xF & "," & xF(1, 2).Text
  11.             St = xF(1, 2)
  12.             Do
  13.                 Set xF = Sheets("菜單(勿動)").[B:B].FindNext(xF)
  14.                 If xF(1, 2) = St Then Exit Do
  15.                 .NoteText .NoteText & Chr(10) & xF & "," & xF(1, 2).Text
  16.             Loop
  17.             .Comment.Visible = True
  18.         End If
  19.     End With
  20. End Sub
複製代碼
感恩的心......(在麻辣家族討論區.用心學習會有進步的)
但資源無限,後援有限,  一天1元的贊助,人人有能力.

TOP

        靜思自在 : 要批評別人時,先想想自己是否完美無缺。
返回列表 上一主題