Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Dec 2002
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Move to new worksheet (97/2000)

    Hi I would like to be able to move some info to another worksheet if it meets a criteria. I would like excel to look at D and if someone stayed more then 4 days to put that person on another worksheet. Also does anyone know where i can get a book to help me with formulas?
    Attached Files Attached Files

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Move to new worksheet (97/2000)

    The VBA code below will do this:

    <pre>Public Sub CopyGT4()
    Dim I As Long, J As Long
    Worksheets("Sheet2").Cells.ClearContents
    Worksheets("sheet1").Range("1:1").Copy Destination:=Worksheets("Sheet2").Range("A1")
    I = 1
    J = 1
    Do While Worksheets("Sheet1").Range("D1").Offset(I, 0).Value <> ""
    If Worksheets("Sheet1").Range("D1").Offset(I, 0).Value > 4 Then
    Worksheets("Sheet1").Range("D1").Offset(I, 0).EntireRow.Copy _
    Destination:=Worksheets("Sheet2").Range("A1").Offs et(J, 0)
    J = J + 1
    End If
    I = I + 1
    Loop
    End Sub
    </pre>

    Legare Coleman

  3. #3
    2 Star Lounger
    Join Date
    Dec 2002
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Move to new worksheet (97/2000)

    Lagare, Thanks for responding to my question. I am new to excel and I am not sure what a VBA code is or how it works, so is there another way other than a VBA code that will work?

  4. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Move to new worksheet (97/2000)

    Unfortunately, I do not see a good way to accomplish this without VBA code. I have attached your original workbook with the code included and a button that will run the code. Click on the button and it should copy the rows you want to Sheet2.
    Attached Files Attached Files
    Legare Coleman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •