返回列表 上一主題 發帖

文具系統

文具系統

您好:
我可以把文具系統改成這個嗎?
我想把領用單裡面的部門單位和申請人名字用這樣選擇.,不然好難找喔
未命名.rar (470.04 KB)

TOP

本帖最後由 mark15jill 於 2012-10-18 15:43 編輯

回復 1# JEAN

個人建議
若要將圖表PO上
請先將相關資料遮蔽~
避免觸法..
資訊安全 及 個人資料安全保護法  這兩種


另外
只丟圖 +一段說明 很難讓人清楚 您要的是什麼?
是額外的表單 或者是  照程式改寫?

  多做多想多學習,少看少錯少迷途

  多做=多多練習,多多編寫。
  多想=想想為什麼人家程式要那樣寫,如果換成自己,又會怎寫。
  多學習=學習人家的發問並解答,學習人家的寫法

  少看=只看不做也枉然

TOP

回復 1# JEAN
2# mark15jill  說的是

試試看 是這方向嗎?


test.rar (13.33 KB)

TOP

因為我不知道要如何說明
才會用這個方式

TOP

文具系統

文具記錄2.rar (95.6 KB)
我改成用選擇的,不想用拉下式選擇。

本帖最後由 GBKEE 於 2012-10-19 15:26 編輯

回復 5# JEAN
試試看
  1. '[領用單]部門單位: B3 有變動 ->申請人名字: B4 會更著變動名單
  2. Private Sub CommandButton1_Click()
  3.     首頁
  4. End Sub
  5. Private Sub CommandButton2_Click()
  6.     Sheets("領用記錄明細表").Visible = True
  7.     Sheets("領用記錄明細表").Select
  8.     Me.Visible = False
  9. End Sub
  10. Private Sub Worksheet_Activate() '製定部門單位的驗證, [領用單]工作表為作用中時的預設件
  11.     Dim Ar As String, xI As Integer
  12.     With Sheets("人員資料").[E2]
  13.         xI = 2
  14.         Do While .Cells(xI) <> ""
  15.             If Ar = "" Then
  16.                 Ar = "," & .Cells(xI, 1)
  17.             Else
  18.                 If InStr(Ar, "," & .Cells(xI)) & "," = 0 Then Ar = Ar & "," & .Cells(xI)
  19.             End If
  20.             xI = xI + 1
  21.         Loop
  22.     End With
  23.     With Range("B3").Validation
  24.         .Delete
  25.         If Ar <> "" Then .Add xlValidateList, , , Mid(Ar, 2)
  26.     End With
  27. End Sub
  28. Private Sub Worksheet_Change(ByVal Target As Range)
  29.     Application.EnableEvents = False
  30.     If Target(1).Address(0, 0) = "B3" Then
  31.         If Target(1) = "" Then Range("B4") = ""
  32.         驗證B4
  33.     End If
  34.     Application.EnableEvents = True
  35. End Sub
  36. Private Sub 驗證B4()
  37.     Dim Ar As String, xI As Integer
  38.     With Sheets("人員資料").[A2]
  39.         xI = 2
  40.         Do While .Cells(xI) <> ""
  41.             If .Cells(xI) = [B3] Then
  42.                 If Ar = "" Then
  43.                     Ar = "," & .Cells(xI, 3)   '中文姓名 在第3欄
  44.                 Else
  45.                     If InStr(Ar, "," & .Cells(xI, 3) & ",") = 0 Then Ar = Ar & "," & .Cells(xI, 3)
  46.                 End If
  47.             End If
  48.             xI = xI + 1
  49.         Loop
  50.     End With
  51.     With Range("B4").Validation
  52.         .Delete
  53.         If Ar <> "" Then .Add xlValidateList, , , Mid(Ar, 2)
  54.     End With
  55. End Sub
複製代碼

TOP

如果要多一個查詢功能應該怎麼做呢??

TOP

這個要怎麼改~~

TOP

回復 7# sheau-lan
要如何查詢??
回復 8# JEAN
5# 附檔 [人員資料] 請先建立名單資料...
6#的程式碼 複製覆蓋  5# [領用單]工作表的程式碼
到活頁簿視窗 頁首  執行領用單 先選B3,再選B4 看看

TOP

我裡面己經有建立人員名單了
是要把程式碼放在領用單裡面嗎

TOP

        靜思自在 : 真正的愛心,是照顧好自己的這顆心。
返回列表 上一主題