How to make secondary cells color of primary
Closed
markhackney
-
Feb 5, 2012 at 10:04 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Feb 14, 2012 at 09:25 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Feb 14, 2012 at 09:25 AM
Related:
- How to make secondary cells color of primary
- Color coding of rj45 - Guide
- Tmobile primary account holder - Guide
- Spacedesk driver software for windows primary pc - Download - Other
- Notepad++ background color - Guide
- Sound card color code - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Feb 14, 2012 at 09:25 AM
Feb 14, 2012 at 09:25 AM
Hi markhackney,
Yes this is possible, but what is the relation between A1 and B1:Z1+C7+E74.
For the following code I assumed that A1 could be any cell and that B1:Z1 is dependent of the row of the selected cell (so if A2 is selected then it will be B2:Z2). C7 and E74 are fixed locations.
First select the cell you would like to copy the color from and then run the following code:
Best regards,
Trowa
Yes this is possible, but what is the relation between A1 and B1:Z1+C7+E74.
For the following code I assumed that A1 could be any cell and that B1:Z1 is dependent of the row of the selected cell (so if A2 is selected then it will be B2:Z2). C7 and E74 are fixed locations.
First select the cell you would like to copy the color from and then run the following code:
Sub Test() Dim aColor, aRow As Integer aColor = ActiveCell.Interior.ColorIndex aRow = ActiveCell.Row Range(Cells(aRow, "B"), Cells(aRow, "Z")).Interior.ColorIndex = aColor Range("C7").Interior.ColorIndex = aColor Range("E74").Interior.ColorIndex = aColor End Sub
Best regards,
Trowa