Results 1 to 2 of 2

Thread: How to copy specific rows to another sheet

  1. #1
    Join Date
    Jan 2009
    Posts
    79

    How to copy specific rows to another sheet

    Hi friends,

    I have created an Excel Sheet in Excel 2007 and now i want to copy some of the specific rows from one sheet to another sheet. I have tried a lot to find it over internet but was not able to get proper solution.

    Can anyone help me out with this issue.

  2. #2
    Join Date
    Jan 2008
    Posts
    3,755

    Re: How to copy specific rows to another sheet

    Try to work on the following code i hope it will work for you.

    Code:
    Sub FindMe()
    Dim intS As Integer
    Dim rngC As Range
    Dim strToFind As String, FirstAddress As String
    Dim wSht As Worksheet
    
    Application.ScreenUpdating = False
    
    intS = 1
    'This step assumes that you have a worksheet named
    'Search Results.
    Set wSht = Worksheets("Search Results")
    strToFind = "Hello"
    
    'Change this range to suit your own needs.
    With ActiveSheet.Range("A1:C2000")
    Set rngC = .Find(what:=strToFind, LookAt:=xlPart)
    If Not rngC Is Nothing Then
    FirstAddress = rngC.Address
    Do
    rngC.EntireRow.Copy wSht.Cells(intS, 1)
    intS = intS + 1
    Set rngC = .FindNext(rngC)
    Loop While Not rngC Is Nothing And rngC.Address <>
    FirstAddress
    End If
    End With
    
    End Sub

Similar Threads

  1. Replies: 4
    Last Post: 01-04-2011, 02:00 AM
  2. how to copy data from sheet 1 to sheet 2 using macro
    By Messenger in forum Windows Software
    Replies: 3
    Last Post: 26-10-2010, 06:28 AM
  3. Copy rows based on a condition
    By Dwin123 in forum Software Development
    Replies: 5
    Last Post: 04-03-2010, 07:27 PM
  4. How can I highlight duplicate rows of excel sheet with color?
    By Sarfaraj Khan in forum Windows Software
    Replies: 5
    Last Post: 08-01-2010, 11:15 AM
  5. Replies: 2
    Last Post: 09-07-2009, 08:57 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,025,857.75406 seconds with 17 queries