X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
> Color One Cell Based On The Conditional Format Of Another, Office 2013    
post Nov 8 2019, 11:58 AM

Posts: 529
Joined: 7-November 10

Hi UA!

I have a question. Currently, I am using two formulas that I would like to combine into one. The first VB highlights the rows and columns for easy following:

[/code]Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Application.ScreenUpdating = False
'Clear all cell colours
Cells.Interior.ColorIndex = 0
With Target
'Row and column highlightingfor the active cell
.EntireRow.Interior.ColorIndex = 19
.EntireColumn.Interior.ColorIndex = 19
End With
Application.ScreenUpdating = True
End Sub[code]

The second VB will color the cell based on a conditionally formatted cell:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Me.Range("T16").Interior.Color = Me.Range("AC16").DisplayFormat.Interior.Color
End Sub[code]

Is there a way to combine this VBA? When I tried to combine it before, I received an "ambiguous name detected" error.

Any ideas?

Thanks so much!
Go to the top of the page

Posts in this topic

Custom Search

RSSSearch   Top   Lo-Fi    18th January 2020 - 08:34 PM