Computing.Net > Forums > Office Software > Highlight Excel Cell by Selecting Different C

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Highlight Excel Cell by Selecting Different C

Reply to Message Icon

Name: zxcvbn_1
Date: April 29, 2009 at 08:26:17 Pacific
OS: Windows Vista
Subcategory: Microsoft Office
Comment:

I want to Highlight Excel Cell by Selecting Different Cell. For example:

Highlight cell H3 When Cell A3 is selected.

But i need to use this method for many other cells.

any ideas?

Thanks.



Sponsored Link
Ads by Google

Response Number 1
Name: Mike (by mmcconaghy)
Date: April 29, 2009 at 09:11:53 Pacific
Reply:

I'm not sure if the act of simply selecting a cell and having the color of a second cell change, is possible.
Maybe with some VBA code.

But you might look at Conditional Formatting
It may be what your looking for.

MIKE

http://www.skeptic.com/


0

Response Number 2
Name: DerbyDad03
Date: April 29, 2009 at 10:43:40 Pacific
Reply:

If there is some sort of "pattern" to the selected/highlighted cells then it could be done with the following code. The pattern I'm assuming here is that the cell you want highlighted is 7 columns away. i.e. A - H

You will also lose the use of one cell as it is required to store the highligthed cell's address so it can turn off the highlighting when you mkae your next selection.

Try this code and if it's even close, let me know what else you need.

Private Sub Worksheet_SelectionChange(ByVal target As Range)
On Error Resume Next
'Get address to reset highlighting
  oldTarget = Range("A1")
'Reset highlighting
  Range(oldTarget).Interior.ColorIndex = xlNone
'Highlight cell 7 columns to the right
  target.Offset(0, 7).Interior.ColorIndex = 6
'Store highlighted cell address for use next time
 Range("A1") = target.Offset(0, 7).Address
End Sub


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: Highlight Excel Cell by Selecting Different C

Excel '07 highlights multiple cells www.computing.net/answers/office/excel-07-highlights-multiple-cells/7536.html

Excel - highlighting cells www.computing.net/answers/office/excel-highlighting-cells/4996.html

Excel - detecting if another cell is selected www.computing.net/answers/office/excel-detecting-if-another-cell-is-selected/9381.html