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
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.
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
Summary: I have an ongoing issue...various spreadsheets (none in particular...could be one or two or all of them) will start taking on this behavior for no apparent reason: when you click an individual cell, i...
Summary: Hi I have a question regarding highlighting Excel cells. I am designing a quiz whereby I have set the conditional formatting to reveal the contents of another cell once the correct answer has been inp...
Summary: Hi - I know absolutely nothing about VB, but have a pretty good working knowledge of Excel. I'm am trying to find out if I can get one cell to tell me if another cell is selected. Not highlighted, s...