|
把你的代码放进去不难, 难的是读懂你描述的事情.
显示相应的数据, 哪些是相应的数据? 举个例子.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column = 3 Then
Application.EnableEvents = False
'你后加的代码
Dim Ddw$, Xdw$, n%
x = Target.Row
On Error GoTo 1000
r = ActiveSheet.Range("R1:V" & Range("R65536").End(xlUp).Row).Find(Target.Value).Row
Ddw = Cells(r, "T"): n = Cells(r, "U"): Xdw = Cells(r, "V")
With UserForm1
.Label3.Caption = "Each " & LTrim(Ddw) & " = " & n & " " & LTrim(Xdw)
.TextBox1.Value = ""
.TextBox2.Value = ""
.TextBox3.Value = ""
.TextBox4.Value = ""
.TextBox5.Value = ""
.Label1 = Cells(r, "T")
.Label2 = Cells(r, "V")
.TextBox3.Visible = False '先隐藏尺寸输入
.TextBox4.Visible = False '先隐藏尺寸输入
.TextBox5.Visible = False '先隐藏尺寸输入
.Label4.Visible = False
.Label8.Visible = False
End With
With UserForm1
.Show
.TextBox1.SetFocus
.Top = ActiveCell.Top + 170
.Left = Range("C1").Left
Application.EnableEvents = True
End With
End If
1000:
End Sub |
评分
-
1
查看全部评分
-
|