View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Programming a 'frozen' cell

Scrolling in and of itself does not generate an event. The closes you will
get is the selection change event so that when a cell is selected the value
will change based on the row number, something like this...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Row < 21 Then
Range("B4").Value = "Revenues"
Else
Range("B4").Value = "Expenses"
End If
End Sub
--
HTH...

Jim Thomlinson


"Paddler" wrote:

I have a budget spreadsheet : cell B4 says 'REVENUES' and cell B20 says
'EXPENSES'. That's fine when I print the spreadsheet.

For onscreen viewing, I 'freeze' rows A:1 thru A:8.

When the screen scrolls to row 21, I want cell B4 to say 'EXPENSES'.

What IF statement or macro code will switch the dispaly in cell B4 when I
'freeze' the titles.