copy highlighted cell from sheet1 and sheet2 and paste the highlighted cell to sheet3

copy highlighted cell from sheet1 and sheet2 and paste the highlighted cell to sheet3
while pasting highlighted cell add  sheet1 highlighted cell  and sheet2 highlighted cell in sheet3
kindly see the sample file
sample-1241.xlsm
Avinash SinghAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You may try something like this...
Sub CopyHighlightedCells()
Dim ws As Worksheet, dws As Worksheet
Dim Cell As Range

Application.ScreenUpdating = False

Set ws = Sheets("Sheet1")
Set dws = Sheets("Sheet3")
For Each Cell In ws.UsedRange.Cells
    'Copy if the cell is highlighted with Red color
    'If it may also any color other than Red, replace the IF condition in be below line with If Cell.Interior.ColorIndex <> xlNone Then
    If Cell.Interior.ColorIndex = 3 Then
        Cell.Copy dws.Range(Cell.Address)
    End If
Next Cell

Set ws = Sheets("Sheet2")
For Each Cell In ws.UsedRange.Cells
    If Cell.Interior.ColorIndex = 3 Then
        Cell.Copy dws.Range(Cell.Address)
    End If
Next Cell

Application.ScreenUpdating = True
End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Avinash SinghAuthor Commented:
Thnx for giving ur precious time Subodh Tiwari (Neeraj) Sir
You r Genius
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome Avinash!
Thanks for the feedback.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.