Highlight cell if copied VBA

DragonPrinces

New Member
Joined
Apr 30, 2013
Messages
32
Hi Guys

I have an interesting question that I'm not sure is possible. Hoping someone here can either answer or let me know it is not possible.

So i have a bunch of data i need to cross reference, unfortunately this particular set of data needs to be sifted through manually.
basically what i have is a folder/file list dump that i brought into excel and i am now sifting though the data looking for incorrect data and fixing what needs to be fixed.

On another workbook i have a list of all my vehicle registrations that i am using as a search reference in the dataset(simply using filter)

What i normally would do is after selecting my registration number to copy i would color it before copying so that at the end i can see if there are any uncolored reg numbers that i need to check why they were missed and investigate further.

So after that long explanation basically I'm asking is, is there some code for Coloring a cell automatically if a copy function is used on it?

Thank you
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
@DragonPrinces In the absence of Copy Event, the best I can come up with is the below.

I'm assuming that your copying, and colouring etc is being done with mouse clicks rather than keyboard shortcuts?

Copy the below codes into a vba Module for testing.
NB Testing will be a bulky but is just to prove it does what you want.

Select cell to be copied and coloured. Then run 'CopyandColour'

Select the cell you wish to paste to and run 'PasteandClear'

If it does what you want then it will be possible to copy the code to a module in your Personal workbook and set up to run both from the Quick Access Toolbar.
Then a single click in the QAT will Copy and colour selected cell. And a single click will paste value only to selection .

VBA Code:
Sub CopyandColour()
    Dim rng As Range
    Set rng = Selection
    With rng
        .Copy
        .Interior.ColorIndex = 35  'light green edit to suit
    End With
End Sub

VBA Code:
Sub PasteandClear()
    Dim rng As Range
    Set rng = Selection
    With rng
       .PasteSpecial Paste:=xlPasteValues
       Application.CutCopyMode = False
    End With
End Sub

Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,248
Members
452,623
Latest member
cliftonhandyman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top