-
Hi Holland
Welcome to VBAX
This may not give expected results for all cases. Enter PO or MR in Cell B5 then run this code from the button
[VBA]
Option Explicit
Sub UpLoad_Click()
Dim WS As Worksheet
Dim Rng As Range
Set WS = Sheets("Status_Log (2)")
With Sheets("Data")
.Columns("A:F").AutoFilter Field:=1, Criteria1:=WS.Range("B5").Text
Set Rng = .Range(.Cells(2, 1), .Cells(Rows.Count, 1).End(xlUp)).SpecialCells(xlCellTypeVisible)
WS.Range("B6") = Rng(1).Offset(, 2)
WS.Range("B7") = Rng(1).Offset(, 3)
WS.Range("B8") = Rng(1).Offset(, 4)
Rng.Offset(, 1).Copy
WS.Range("A11").PasteSpecial xlValues
Rng.Offset(, 5).Copy
WS.Range("B11").PasteSpecial xlValues
.Columns("A:F").AutoFilter
End With
WS.Range("B5").Select
End Sub
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules