JinRua
Thành viên mới
- Tham gia
- 9/12/11
- Bài viết
- 45
- Được thích
- 45
Private Sub ComboBox1_Change()
End Sub
Private Sub CommandButton1_Click()
Dim Rng As Range
Application.ScreenUpdating = False
Set Rng = Sheet1.Range("H1:H" & Sheet1.Range("H65500").End(xlUp).Row).Find(Range("E3").Value, , , xlValue)
If Not Rng Is Nothing Then
Range("E3").Resize(15).Copy
Rng.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=True
End If
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rng As Range
Application.ScreenUpdating = False
If Target.Address = "$C$1" Then
Set Rng = Sheet1.Range("H1:H" & Sheet1.Range("H65500").End(xlUp).Row).Find(Target.Value, , , xlValue)
If Not Rng Is Nothing Then
Rng.Resize(, 15).Copy
Range("E3").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=True
End If
End If
If Target.Address = "$E$1" Then
Set Rng = Sheet1.Range("I1:I" & Sheet1.Range("I65500").End(xlUp).Row).Find(Target.Value, , , xlValue)
If Not Rng Is Nothing Then
Rng.Offset(, -1).Resize(, 15).Copy
Range("E3").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=True
End If
End If
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
End Sub
Private Sub CommandButton1_Click()
Dim Rng As Range
Application.ScreenUpdating = False
Set Rng = Sheet1.Range("H1:H" & Sheet1.Range("H65500").End(xlUp).Row).Find(Range("E3").Value, , , xlValue)
If Not Rng Is Nothing Then
Range("E3").Resize(15).Copy
Rng.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=True
End If
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rng As Range
Application.ScreenUpdating = False
If Target.Address = "$C$1" Then
Set Rng = Sheet1.Range("H1:H" & Sheet1.Range("H65500").End(xlUp).Row).Find(Target.Value, , , xlValue)
If Not Rng Is Nothing Then
Rng.Resize(, 15).Copy
Range("E3").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=True
End If
End If
If Target.Address = "$E$1" Then
Set Rng = Sheet1.Range("I1:I" & Sheet1.Range("I65500").End(xlUp).Row).Find(Target.Value, , , xlValue)
If Not Rng Is Nothing Then
Rng.Offset(, -1).Resize(, 15).Copy
Range("E3").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=True
End If
End If
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub