Results 1 to 22 of 22

copy cell color to another sheetint cell with same value

Threaded View

  1. #4
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: copy cell color to another sheetint cell with same value

    Here is an option for you

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim clr, lr, lc, i, j As Long
    Dim ws As Worksheet
    Dim rec As Range
    
    Set ws = Sheet2
    If Target.Cells.Count > 1 Then Exit Sub
    If Not Intersect(Target, Range("A:A")) Is Nothing Then
        lr = ws.Range("A" & Rows.Count).End(xlUp).Row
        lc = ws.UsedRange.SpecialCells(xlCellTypeLastCell).Column
        clr = Target.Interior.Color
        For i = 1 To lr
            For j = 1 To lc
                If Target.Value = ws.Cells(i, j).Value Then
                    ws.Cells(i, j).Interior.Color = clr
                End If
            Next j
        Next i
    End If
    End Sub
    Attached Files Attached Files
    Last edited by maniacb; 11-12-2020 at 05:32 PM. Reason: Add file

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. SOLVED: Excel VBA Copy Paste Color Cell Range to Selected Cell
    By chhiew in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-22-2018, 02:25 AM
  2. User defined function to copy the cell color to another cell (actual painting the color)
    By sumitgangwani in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-15-2017, 04:14 PM
  3. Change cell format (cell color+font color) based on color of another cell
    By Dedaluss in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-30-2017, 03:27 AM
  4. Replies: 2
    Last Post: 01-31-2014, 09:34 AM
  5. [SOLVED] Macro: Use cell fill color to determine if to copy & paste to another cell on the same row
    By tsamuels in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-19-2013, 09:50 AM
  6. Use VBA to copy Data Validation reference cell font color to destination cell?
    By proav in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-07-2012, 08:09 PM
  7. Replies: 2
    Last Post: 11-08-2011, 11:10 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