I have 2 tables consisting of six quarters of data, the first table contains bank names and the second adjacent table contains the values associated with each bank. Each quarter of data is sorted in ascending order according to corresponding values in values table.
I have a drop down box that allows user to select a bank which in turn highlights all occurrences of that bank name in the table. I need the corresponding values to also be highlighted as well. This could easily be accomplished using conditional formatting feature in later versions of excel but excel 2003 does not provide necessary options(applies to option, for example). The dropdown is in <CODE>A1</CODE>, bank rankings in <CODE>C3:O17</CODE>, and values in J<CODE>3:O17
</CODE>The code below removes highlight from previously selected bank and calls code that highlights currently selected bank from drop down.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Target.Worksheet.Range("A1")) Is Nothing Then HighLightCells2
End Sub
This code highlights currently selected bank from drop down.
Sub HighLightCells2()
ActiveSheet.UsedRange.Cells.FormatConditions.Delete
If Not Range("A1") = vbNullString Then
ActiveSheet.UsedRange.Cells.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:=Range("A1")
ActiveSheet.UsedRange.Cells.FormatConditions(1).Interior.ColorIndex = 4
End If
End Sub
I think a formula =$A$1=C3 is necessary to apply highlight to value cells but I am not certain of syntax and whether(or how) it should be added in the above code as a format condition. I can provide any further details necessary.
I have a drop down box that allows user to select a bank which in turn highlights all occurrences of that bank name in the table. I need the corresponding values to also be highlighted as well. This could easily be accomplished using conditional formatting feature in later versions of excel but excel 2003 does not provide necessary options(applies to option, for example). The dropdown is in <CODE>A1</CODE>, bank rankings in <CODE>C3:O17</CODE>, and values in J<CODE>3:O17
</CODE>The code below removes highlight from previously selected bank and calls code that highlights currently selected bank from drop down.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Target.Worksheet.Range("A1")) Is Nothing Then HighLightCells2
End Sub
This code highlights currently selected bank from drop down.
Sub HighLightCells2()
ActiveSheet.UsedRange.Cells.FormatConditions.Delete
If Not Range("A1") = vbNullString Then
ActiveSheet.UsedRange.Cells.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:=Range("A1")
ActiveSheet.UsedRange.Cells.FormatConditions(1).Interior.ColorIndex = 4
End If
End Sub
I think a formula =$A$1=C3 is necessary to apply highlight to value cells but I am not certain of syntax and whether(or how) it should be added in the above code as a format condition. I can provide any further details necessary.