Copy Cells to another sheet based on fill colour

pwilson06

New Member
Joined
Jul 9, 2020
Messages
5
Office Version
  1. 365
Platform
  1. Windows
HI,
I have a page set up that has a macro to fill the cell yellow(Interior.ColorIndex = 6) when the value changes. I use this page to do price changes for products that we sell, which is a catalouge of over 600 products.
Is there a way (VBA??) I can use to have the highlighted cells copied to another sheet to show a customer just the items/prices that have changed rather than sending them a product list with all 600+ products.
Some of the cells that need to be copied have formulas in them but I only need to paste the values.
Thanks
 
Try this:

VBA Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

    Dim lngPasteRow As Long
    
    If Target.Column >= 3 And Target.Column <= 16 And Target.Row >= 4 Then 'Only works on range C4:P [whatever row]
        With Application
            .ScreenUpdating = False
            .EnableEvents = False
        End With
        Target.Interior.ColorIndex = 6
        If Target.Column = 15 Then
            On Error Resume Next
                lngPasteRow = Sheets("Rayners Price Changes").Range("A:C").Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
                If lngPasteRow = 0 Then
                    lngPasteRow = 3
                Else
                    lngPasteRow = lngPasteRow + 1
                End If
            On Error Resume Next
            Sheets("Rayners Price Changes").Range("A" & lngPasteRow).Value = Range("C" & Target.Row).Value
            Sheets("Rayners Price Changes").Range("B" & lngPasteRow).Value = Range("D" & Target.Row).Value
            Sheets("Rayners Price Changes").Range("C" & lngPasteRow).Value = Range("O" & Target.Row).Value
        End If
        With Application
            .EnableEvents = True
            .ScreenUpdating = True
        End With
    End If
    
End Sub
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

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