View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pete Csiszar Pete Csiszar is offline
external usenet poster
 
Posts: 5
Default Help with setting range limits

Hi All,

I have put together the following sub which changes the color of whatever
cell is active to green.

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Excel.Range)
Static DataField As Range
If Not DataField Is Nothing Then
DataField.Interior.ColorIndex = xlColorIndexNone
End If
Target.Interior.ColorIndex = 4
Set DataField = Target

End Sub


My problem is that I have been unable to limit this routine to a specific
range of cells (actually two specific ranges) in this case D7:D14 and F7:F14

As it is right now, no matter what cell I click on, it turns green.

Any help would be much appreciated.

Pete