View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
paul mueller paul mueller is offline
external usenet poster
 
Posts: 6
Default selecting a cell in sheet1

that will then take you to a cell on sheet2 with the same value and
hightlight the row the cell is on.
I can't seem to figure out how to only be able to use range e1:e20 to cause
the sub to start but still allow other cells to be changed without causing
the sub to start.
Also i can get the active cell to match and get to sheet2, but cannot figure
out how to select the matching cell on sheet2 and highlight the row the
matching cell is on.
This is what i have so far.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim selection, val
selection = ActiveCell 'should be sheet1
range e1:e20
val = Worksheets("sheet2").Range("h1:h20")
For Each cell In val
If cell = selection Then
Worksheets("sheet2").Activate 'should activate
matching cell and highlight row

End If
Next
End Sub


Any help would be greatly appreciated.

Paul