|
- Private Sub CommandButton1_Click()
- Dim s1 As String, rg As Range, s2 As String
- On Error Resume Next
- s1 = [T39]
- If Not IsEmpty([s20]) Then
- With Worksheets("sheet2")
- [T20] = .Range("Q37").Offset([s20], 1)
- [R20] = .Range("Q37").Offset([s20], 3)
- End With
- 'MsgBox Worksheets("sheet2").Range("Q37").Offset([s20], 1)
- 'MsgBox Worksheets("sheet2").Range("Q37").Offset([s20], 3)
- End If
- If Not IsEmpty([T39]) Then
- With Worksheets("sheet2")
- Set rg = .Range("C12:N12").Find(what:=s1, lookat:=xlWhole)
- If Not rg Is Nothing Then
- 'MsgBox rg.Offset(-1)
- s1 = rg.Offset(-1)
- Set rg = .Range("R38:R49").Find(what:=s1, lookat:=xlWhole)
- If Not rg Is Nothing Then
- [t35] = rg.Offset(, 1).Value
- 's1 = rg.Offset(, 1)
- 'MsgBox s1
- End If
- End If
- End With
- End If
- End Sub
复制代码 |
|