標題:
[發問]
請問有關表單查詢問題
[打印本頁]
作者:
afu9240
時間:
2018-10-4 16:33
標題:
請問有關表單查詢問題
各位大大及超強版主好
附件查詢部分 員工姓名欄輸入"劉德華",會在sheets2顯示資料,但A欄~D欄的資料卻無法顯示,,,,有高手可以解惑嗎????非常感恩 謝謝
[attach]29500[/attach]
作者:
GBKEE
時間:
2018-10-5 06:06
回復
1#
afu9240
Private Sub CommandButton3_Click() '查詢
Dim a As Range
Dim r As Integer, i As Integer, j As Integer
If TextBox12.Text = "" Then
MsgBox "請輸入正確的值"
Exit Sub
End If
Application.ScreenUpdating = False
ListBox1.Clear
Worksheets("工作表2").Range("A:P").ClearContents
With Worksheets("工作表1")
r = Application.CountA(.Range("E:E"))
For Each a In .Range("E1:E" & r)
If InStr(1, a, TextBox12, vbTextCompare) Then
With ListBox1
.AddItem
i = .ListCount
For j = 0 To 9 '沒有跳位可不必Step 1 ' For j = 9 To 0 Step -1 才需要
.List(i - 1, j) = a.Offset(, j)
Next
End With
Worksheets("工作表2").Cells(i, 1).Range("A1:N1") = .Cells(a.Row, 1).Range("A1:N1").Value
End If
Next
End With
Application.ScreenUpdating = True
End Sub
複製代碼
作者:
hcm19522
時間:
2018-10-5 15:09
工作表2 B1右拉下拉{=INDEX(工作表1!F:F,SMALL(IF(工作表1!$E$2:$E$13=$A$1,ROW($2:$13),4^8),ROW(A1)))&""
作者:
afu9240
時間:
2018-10-7 14:32
回復
2#
GBKEE
感謝G大版主 得回覆 感謝*100000
作者:
afu9240
時間:
2018-10-11 16:46
回復
2#
GBKEE
G大版主 您好
不好意思,想再請教您一個問題~~~如下圖~~要如何做單一項目做修改儲存(附上檔案, 疑惑中 請協助~~謝謝
[attach]29520[/attach]
[attach]29521[/attach]
作者:
afu9240
時間:
2018-10-11 16:59
不好意思 我已經解決了
作者:
GBKEE
時間:
2018-10-13 08:51
回復
6#
afu9240
還有進步空間
努力加油
Option Explicit
Dim strx As Integer, MyData As Worksheet
Private Sub MultiPage1_Change()
If MultiPage1.SelectedItem.Index = 2 Then
With SpinButton1
.Enabled = .Min > 0
If .Min = 0 Then MsgBox "資料庫是空的!!!!"
'可將 財產編號下的資料移空看看
End With
End If
End Sub
Private Sub SpinButton1_Change()
Dim Ar, i As Integer
With SpinButton1
If .Min = 0 Then Exit Sub
Ar = Array(14, 2, 1, 3, 4, 5, 6, 7, 11, 8, 9, 12, 10)
For i = 0 To UBound(Ar)
Controls("l" & i + 1).Caption = MyData.Cells(.Value, Ar(i))
Next
Label46.Caption = "第 " & .Value - 1 & " 筆" & IIf(.Value = .Max, " - 最後一筆了", "")
End With
End Sub
Private Sub UserForm_Activate()
MultiPage1_Change
End Sub
Private Sub UserForm_Initialize()
Set MyData = Sheets("工作表1")
With MyData.Range("A1").End(xlDown)
If .Row = Rows.Count Then
SpinButton1.Min = 0
Else
SpinButton1.Min = 2
SpinButton1.Max = .Row
SpinButton1.Value = SpinButton1.Min
End If
End With
ListBox1.ColumnCount = 10
ListBox1.ColumnWidths = "50,50,50,50,70,70,70,70,70,70"
ComboBox1.List = Array("人力資源部", "資訊服務部", "音響資材部", "音響業務部", "技術部" _
, "電子研發部", "音響機構部", "音響客服", "廠務", "財務部", "稽核", "總經理室")
'*************以下自己試試看 **********
End Sub
複製代碼
作者:
afu9240
時間:
2018-10-14 10:07
回復
7#
GBKEE
感謝G大鼓勵與回復~~~我會努力的 謝謝
作者:
afu9240
時間:
2019-6-6 16:27
回復
2#
GBKEE
G大您好
如果欄位超過10個會顯示下方圖樣問題~~,,有辦法處理嗎???感謝*1000
[attach]30785[/attach][attach]30786[/attach]
歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)