Results 1 to 2 of 2

automatically copy cells from one sheet to another sheet using a macro

This is a discussion on automatically copy cells from one sheet to another sheet using a macro within the Excel Questions forums, part of the Question Forums category; I'm looking for an excel macro that can copy rows from one sheet to another within excel based upon having ...

  1. #1
    New Member
    Join Date
    Feb 2012
    Posts
    3

    Smile automatically copy cells from one sheet to another sheet using a macro

    I'm looking for an excel macro that can copy rows from one sheet to another within excel based upon having a specific word in the cell. I have one sheet called master and sheet two called feedback. Here is an example of the data:

    ABCD
    marybob56reply soon
    samjohn26keep in touch
    sylviapan15response needed


    I'd like to copy the rows sheet "master" to sheet "feedback" if the data in column D contains either the word reply or the word response somewhere within the paragraph. Additionally I would like to be able to fill in columns E and F in sheet "feedback" once the data has been copied.

    Thank you in advance for your help!
    hrhr
    Last edited by hrhr; Feb 16th, 2012 at 08:40 AM.

  2. #2
    Board Regular
    Join Date
    Sep 2007
    Location
    New Jersey USA
    Posts
    3,364

    Default Re: automatically copy cells from one sheet to another sheet using a macro

    Quote Originally Posted by hrhr View Post
    I'm looking for an excel macro that can copy rows from one sheet to another within excel based upon having a specific word in the cell. I have one sheet called master and sheet two called feedback. Here is an example of the data:

    ABCD
    marybob56reply soon
    samjohn26keep in touch
    sylviapan15response needed


    I'd like to copy the rows sheet "master" to sheet "feedback" if the data in column D contains either the word reply or the word response somewhere within the paragraph. Additionally I would like to be able to fill in columns E and F in sheet "feedback" once the data has been copied.

    Thank you in advance for your help!
    hrhr

    Does this help?

    Code:
    Sub hrhr()
    '
    Dim lr As Long
    
    Sheets("Master").Activate
    
    lr = Cells(Rows.Count, 1).End(xlUp).Row
    
        With Range("D2:D" & lr)
    
            .AutoFilter Field:=1, Criteria1:="=*reply*"
            .SpecialCells(xlCellTypeVisible).EntireRow.Copy Sheets("Feedback").Range("A" & Rows.Count).End(3)(2)
            .AutoFilter Field:=1, Criteria1:="=*response*"
            .SpecialCells(xlCellTypeVisible).EntireRow.Copy Sheets("Feedback").Range("A" & Rows.Count).End(3)(2)
    
        End With
        
    ActiveSheet.AutoFilterMode = False
    
    End Sub

Tags for this Thread

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
  •  


DMCA.com