Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Copy Row to worksheet based on criteria
I currently have a worksheet which is being used as a monitoring form. On this form there is a milestone which requires the subject to enter a completion date or a revised date for completion (3 columns in Total).
What I would like to be able to do is copy any row(s) that have a figure entered into revised date column into sheet 2 of the workbook. That way I should have a worksheet (sheet 2) That would have a list that contained all the milestones with revised dates. What I am looking for is any advice on the best way to go about this? I was thinking about using code to do this (possibly implemented by a command button). Although my knowlege of code is quite limited. Many Thanks JP |
#2
|
|||
|
|||
With help from elsewhere I've got what I was looking for.
Code:
Sub CopySheet1toSheet2() Dim OutSH As Worksheet, i As Long Sheets("CorrectiveMeasures").Cells.ClearContents Set OutSH = Sheets("CorrectiveMeasures") i = 0 ii = 7 With Sheets("Milestones") For Each Ce In .Range("f9:f38" & .Cells(Rows.Count, 1).End(xlUp).Row) If Ce.Value 0 Then i = i + 1 Range(Ce.Offset(0, -5), Ce.Offset(0, -3)).Copy _ Destination:=OutSH.Cells(ii, 1) ii = ii + 1 End If Next Ce End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy entire row to another sheet based on a criteria | Excel Discussion (Misc queries) | |||
Transferring data from one worksheet to another based on criteria | Excel Discussion (Misc queries) | |||
Copying data from one worksheet to another based on criteria | Excel Discussion (Misc queries) | |||
copy rows meeting criteria to another worksheet | Excel Worksheet Functions | |||
Can I select a worksheet based upon a cell criteria?(for printing) | Excel Worksheet Functions |