these are my codes:
Sub get_data8()
Dim dteDateIn As Date
dteDateIn = Range("A32").Value
Range("G4").Select
Range(Selection, Selection.End(xlToRight)).Select
For Each testcell In Selection
If dteDateIn = testcell.Value Then
NextFourForward = Range(Cells(4, testcell.Column + 0), Cells(4, testcell.Column + 3)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Range("B33").Select
ActiveSheet.Paste
Exit For
End If
Next testcell
Range("E5").Select
Range(Selection, Selection.End(xlDown)).Select
For Each testcell In Selection
If dteDateIn = testcell.Value Then
NextFourUpward = Range(Cells(testcell.Row - 0, 5), Cells(testcell.Row - 3, 5)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Range("a34").Select
ActiveSheet.Paste
Exit For
End If
Next testcell
Cells(33, 1).Select
End Sub
|