Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 7
Question 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   Report Post  
Junior Member
 
Posts: 7
Default

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
It is activated with a command button. If a date(s) is(are) entered into the range F9:F38 and the command button is clicked then cells A-C of that row(s) are pasted onto sheet CorrectiveMeasures starting on row 7.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy entire row to another sheet based on a criteria Brig Siton Excel Discussion (Misc queries) 3 August 7th 06 09:04 PM
Transferring data from one worksheet to another based on criteria dread Excel Discussion (Misc queries) 5 July 28th 06 07:37 PM
Copying data from one worksheet to another based on criteria Caatt Excel Discussion (Misc queries) 1 June 15th 06 10:19 AM
copy rows meeting criteria to another worksheet confused Excel Worksheet Functions 4 October 4th 05 11:51 AM
Can I select a worksheet based upon a cell criteria?(for printing) Tim Richards Excel Worksheet Functions 0 March 30th 05 07:03 PM


All times are GMT +1. The time now is 05:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"