ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Linking cells by cell text.......................TIA (https://www.excelbanter.com/excel-programming/327468-linking-cells-cell-text-tia.html)

Boll Weevil

Linking cells by cell text.......................TIA
 
Hi,

On sheet one, I have a large table with unique 4 digit hexidecimal values in
each cell.

On sheet two, I have uniquely colored columns of cells of hexidecimal values.
The same values picked from

What I want to happen is to have get the cells automatically assign themselves a
color from the color group they are assigned to from sheet two. So, if I type
04AC in the red column in sheet 2. The corresponding 04AC cell in sheet one
would turn red.

Thanx all for any help.

K Dales[_2_]

Linking cells by cell text.......................TIA
 
You could put the code in the Worksheet_Change event of the sheet you are
using to enter the numbers. The code assumes the entire format - not just
cell color - will be the same but could be modified if that is not OK. To
modify it you would need to read Target's Interior.Color and then set the
FoundRange Interior to the same color.

Private Sub Worksheet_Change(ByVal Target As Range)

Dim InputRange As Range, MatchRange As Range, FoundRange As Range
Set InputRange = Range("A:D") ' the color-coded columns on sheet2
Set MatchRange = Sheets("Sheet1").Range("A1:C4") ' The table of codes on
sheet 1

' First, see if the cell changed is in one of the columns (don't want to run
the find for any other cell entries, would waste time)
If Not (Intersect(Target, InputRange) Is Nothing) Then
' Now, look for the value on sheet1
Set FoundRange = MatchRange.Find(Target.Value)
If Not FoundRange Is Nothing Then ' If found...
Target.Copy
FoundRange.PasteSpecial xlPasteFormats
Application.CutCopyMode = False
End If
End If

End Sub



"Boll Weevil" wrote:

Hi,

On sheet one, I have a large table with unique 4 digit hexidecimal values in
each cell.

On sheet two, I have uniquely colored columns of cells of hexidecimal values.
The same values picked from

What I want to happen is to have get the cells automatically assign themselves a
color from the color group they are assigned to from sheet two. So, if I type
04AC in the red column in sheet 2. The corresponding 04AC cell in sheet one
would turn red.

Thanx all for any help.



All times are GMT +1. The time now is 03:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com