+ Reply to Thread
Results 1 to 3 of 3

Copy the whole row in another sheet if Value in a cell is YES

  1. #1
    Registered User
    Join Date
    02-19-2013
    Location
    Cebu, Philippines
    MS-Off Ver
    Excel 2010
    Posts
    88

    Post Copy the whole row in another sheet if Value in a cell is YES

    Hi,

    Please help..

    It seems that this Codes only copy the Column B. I need to capture the whole Row and reflect it to another sheet.



    Sub RangeCopyPaste()
    Dim cell As Range
    Dim NewRange As Range
    Dim MyCount As Long
    MyCount = 1

    For Each cell In Worksheets("Sheet1").Range("C2:C10")
    If cell.Value = "YES" Then
    If MyCount = 1 Then Set NewRange = cell.Offset(0, -1)
    Set NewRange = Application.Union(NewRange, cell.Offset(0, -1))
    MyCount = MyCount + 1
    End If
    Next cell

    NewRange.Copy Destination:=Worksheets("Sheet2").Range("A2")


    End Sub


    Thank you in advance!

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy the whole row in another sheet if Value in a cell is YES

    Try

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-19-2013
    Location
    Cebu, Philippines
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: Copy the whole row in another sheet if Value in a cell is YES

    It Works!

    Thank You very much AB33.

    This saves a lot of effort and time..

    Mabuhay ka! Salamat!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. copy a specif cell value, find another like that in sheet copy adjacent cell and pate
    By smwaqas89 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2013, 10:00 AM
  2. [SOLVED] Macro to Copy Data from one Sheet A to Sheet B based on value in cell on sheet A
    By scass in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-11-2012, 07:21 PM
  3. Replies: 0
    Last Post: 06-24-2012, 11:23 AM
  4. Replies: 13
    Last Post: 04-04-2012, 01:25 AM
  5. Replies: 1
    Last Post: 10-30-2009, 10:58 AM

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1