|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Private Sub 信息提取_Click()
ThisWorkbook.Activate
Dim i As Integer
Dim HS As Integer
Dim LS As Integer
For Each XWH In Sheet2.Range("C4:C1000")
If XWH.Text = ComboBox153.Text Then
HS = XWH.Row
LS = XWH.Column
End If
Next
'MsgBox "行号为" & HS & "-" & "列号为" & LS
'文本框取值
For i = 1 To 369 Step 1
窗口.Controls("TextBox" & i).Text = Sheet2.Cells(HS, i + 1)
Next
'复合框取值
For i = 1 To 152 Step 1
窗口.Controls("ComboBox" & i).Text = Sheet2.Cells(HS, i + 370)
Next
'文本框取值
For i = 1 To 9 Step 1
窗口.Controls("TextBox" & i + 399).Text = Sheet2.Cells(HS, i + 522)
Next
'复合框取值
For i = 1 To 3 Step 1
窗口.Controls("ComboBox" & i + 199).Text = Sheet2.Cells(HS, i + 531)
Next
TextBox410.Text = Sheet2.Cells(HS, 535).Text
End Sub
|
|