回覆列表
  • 1 # 羊毛學院

    可用VBA來做,例如:Sub try()Set d = CreateObject("Scripting.Dictionary")Dim rag As Range, i As Long, j As Long, arr, brr, tempFor Each rag In Worksheets("表1").Range("B2:B" & Worksheets("表1").Range("B65536").End(xlUp).Row)If d.exists(rag.Value) Thend(rag.Value) = d(rag.Value) & " " & rag.Offset(, -1).ValueElsed(rag.Value) = rag.Offset(, -1).ValueEnd IfNextarr = d.keysbrr = d.itemsFor i = 1 To d.Count - 1 For j = d.Count To i + 1 Step -1 If arr(j - 2) > arr(j - 1) Then temp = arr(j - 2) arr(j - 2) = arr(j - 1) arr(j - 1) = temp temp = brr(j - 2) brr(j - 2) = brr(j - 1) brr(j - 1) = temp End If Next jNext iWorksheets("表2").Columns("A:A").SelectSelection.NumberFormatLocal = "@"Worksheets("表2").Range("A:B").ClearContentsWorksheets("表2").Range("A1") = "生日"Worksheets("表2").Range("B1") = "姓名"For i = 1 To d.CountWorksheets("表2").Range("A" & i + 1).Value = arr(i - 1)Worksheets("表2").Range("B" & i + 1).Value = brr(i - 1)Next iEnd Sub

  • 2 # 使用者444465804192

    在C1中輸入或複製貼上下列公式

    =B1&IFERROR(","&VLOOKUP(A1,A2:C$12,3,0),"")

    下拉填充

    在E1中輸入或複製貼上下列公式

    =VLOOKUP(D1,A:C,3,0)

    下拉填充

  • 中秋節和大豐收的關聯?
  • WORD中目錄的點怎麼打上去?