UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Color One Cell Based On The Conditional Format Of Another, Office 2013    
 
   
halefamily104
post Nov 8 2019, 11:58 AM
Post#1



Posts: 512
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
[/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:

CODE
[/code]
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
 
Debaser
post Nov 8 2019, 04:02 PM
Post#2



Posts: 157
Joined: 11-October 18



Just move this line:

CODE
Me.Range("T16").Interior.Color = Me.Range("AC16").DisplayFormat.Interior.Color


to the top of the other SelectionChange code.
Go to the top of the page
 
halefamily104
post Nov 13 2019, 09:05 AM
Post#3



Posts: 512
Joined: 7-November 10



Perfect!!!!!!

That did it Debaser!

Thanks so much!!!! notworthy.gif

woohoo.gif uarulez2.gif

Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    14th December 2019 - 06:43 AM