+ Reply to Thread
Results 1 to 17 of 17

Copy Row of Highlighted Cell

Hybrid View

  1. #1
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Copy Row of Highlighted Cell

    Maybe:

    Sub asilocyra()
    Dim mycell As Range
    
    
    'For each cell in sheet2 that is not the same in Sheet1, color it yellow
    For Each mycell In ActiveWorkbook.Worksheets(shtSheet2).UsedRange
    If Not mycell.Value = ActiveWorkbook.Worksheets(shtSheet1).Cells(mycell.row, mycell.Column).Value Then
    
    mycell.Interior.color = vbYellow
    Rows(mycell.row).Copy Sheets(shtSheet1).Cells(mycell.row, 1)
    
    End If
    Next
    
    'For each cell in sheet2 that is not the same in Sheet1, color it yellow
    For Each mycell In ActiveWorkbook.Worksheets(shtSheet1).UsedRange
    If Not mycell.Value = ActiveWorkbook.Worksheets(shtSheet2).Cells(mycell.row, mycell.Column).Value Then
    
    mycell.Interior.color = vbYellow
    Rows(mycell.row).Copy Sheets(shtSheet2).Cells(mycell.row, 1)
    End If
    Next
    
    ActiveWorkbook.Sheets(shtSheet2).Select
    End Sub

  2. #2
    Registered User
    Join Date
    07-10-2017
    Location
    Philippines
    MS-Off Ver
    MS OFFICE 2016
    Posts
    38

    Re: Copy Row of Highlighted Cell

    Working on it. just wondering how to paste that copy code

  3. #3
    Registered User
    Join Date
    07-10-2017
    Location
    Philippines
    MS-Off Ver
    MS OFFICE 2016
    Posts
    38

    Re: Copy Row of Highlighted Cell

    Quote Originally Posted by JOHN H. DAVIS View Post
    Maybe:

    Sub asilocyra()
    Dim mycell As Range
    
    
    'For each cell in sheet2 that is not the same in Sheet1, color it yellow
    For Each mycell In ActiveWorkbook.Worksheets(shtSheet2).UsedRange
    If Not mycell.Value = ActiveWorkbook.Worksheets(shtSheet1).Cells(mycell.row, mycell.Column).Value Then
    
    mycell.Interior.color = vbYellow
    Rows(mycell.row).Copy Sheets(shtSheet1).Cells(mycell.row, 1)
    
    End If
    Next
    
    'For each cell in sheet2 that is not the same in Sheet1, color it yellow
    For Each mycell In ActiveWorkbook.Worksheets(shtSheet1).UsedRange
    If Not mycell.Value = ActiveWorkbook.Worksheets(shtSheet2).Cells(mycell.row, mycell.Column).Value Then
    
    mycell.Interior.color = vbYellow
    Rows(mycell.row).Copy Sheets(shtSheet2).Cells(mycell.row, 1)
    End If
    Next
    
    ActiveWorkbook.Sheets(shtSheet2).Select
    End Sub
    Thank you for the suggestion, but for some reason it doesn't work.

+ 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 Highlighted Cell to Another Worksheet
    By spencerp237 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-23-2017, 03:15 PM
  2. simple one: If cell highlighted, then copy value
    By hmm321 in forum Excel General
    Replies: 4
    Last Post: 10-26-2015, 02:24 AM
  3. [SOLVED] Copy entire row if cell is highlighted
    By bdrilling33 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-02-2014, 10:13 AM
  4. Copy Highlighted Cell from one tab to another
    By nhunt in forum Excel General
    Replies: 3
    Last Post: 10-31-2013, 02:16 AM
  5. Copy Highlighted Cell And Paste
    By samdegg in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-28-2013, 06:23 PM
  6. Copy a Row to another sheet of a cell in a column is highlighted
    By kdsanderson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-30-2013, 11:52 AM
  7. Replies: 2
    Last Post: 12-05-2012, 09:54 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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1