Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Copy rows to new worksheet on condition

  1. #11
    New Member
    Join Date
    Jul 2009
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Copy rows to new worksheet on condition

    Quote Originally Posted by mlangen View Post
    When I run this it only copies the header row into a newly created results worksheet?

    Once I get this working it is exactly what I was looking for...
    I googled for way to extract data in almost the same manner and I found this page. I followed the exact instruction and ran it and it only copied the header row like you said. how do you eventually get it working? i will deeply appreciate if you can tell me what modifications have you done?

    and my criteria is positive figure ( >0 ) as opposed to zero ( =0 ) hence "almost".

  2. #12
    Board Regular
    Join Date
    Nov 2008
    Location
    Seattle, WA
    Posts
    246
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Copy rows to new worksheet on condition

    I have the code at work, I will update this thread tomorrow.

  3. #13
    New Member
    Join Date
    Jul 2009
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Copy rows to new worksheet on condition

    Thanks. looking forward to your solution..

  4. #14
    Board Regular
    Join Date
    Nov 2008
    Location
    Seattle, WA
    Posts
    246
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Copy rows to new worksheet on condition

    Send me your email and I will send you the workbook.
    Code:
    Public Sub DefectsStateTrending()
    Dim x As Variant
    Dim dc1 As String
    Dim src As Worksheet
    Dim dst As Worksheet
    Dim LastR As Range
    Set src = Worksheets("Data_Consolidation")
    Set dst = Worksheets("Defect Metrics")
    x = Application.Match(CLng(Date), dst.Columns(1), 0)
    If IsError(x) Then
        Set LastR = dst.Range("a" & Rows.Count).End(xlUp)(2)
    Else
        Set LastR = dst.Range("a" & x)
    End If
    LastR.Value = Date
    src.Range("d2:d7").Copy
    LastR.Offset(, 1).PasteSpecial Paste:=xlPasteValues, Transpose:=True
     
     
    End Sub

  5. #15
    Board Regular sadi's Avatar
    Join Date
    Jun 2009
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Copy rows to new worksheet on condition

    thanks

    my address is sadi_jebon@yahoo.com

  6. #16
    New Member
    Join Date
    Jul 2009
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Copy rows to new worksheet on condition

    Hi i have a spreadsheet( Sheet1) with around 5 thousand rows and 4 columns. I want to be able to copy all the rows which have the word "ISDA" contained in the second column (column B) and paste it into Sheet2. I tried using your code but it didint seem to work for me. Any help would be appreciated.

    Thanks

  7. #17
    New Member
    Join Date
    Jun 2011
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Copy rows to new worksheet on condition

    Hi IanMac

    Your code helped me what I was searching for. I just need one help as in your last code if cell N=0 it will open a new sheet and copy the required content.

    I need that every time I save me current sheet with making the changes or addining new contents it will automaticaly replace the sheet in place of creating new.

    Can you please share me tha code for the same.

    Thanks

  8. #18
    New Member
    Join Date
    Jun 2011
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Copy rows to new worksheet on condition

    Hi IanMac

    Your code helped me what I was searching for. I just need one help as in your last code if cell N=0 it will open a new sheet and copy the required content.

    I need that every time I save me current sheet with making the changes or addining new contents it will automaticaly replace the sheet in place of creating new.

    Can you please share me tha code for the same.

    Thanks

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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