Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programming a 'frozen' cell
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programming a 'frozen' cell
Jim
Yes it works 'but'. I have 23 sheets in this budget workbook. Is there one place to put the code so it works on all sheets or do I insert your code in each worksheets code page? Excel VBA is foreign to me but I do some Access VBA. Access has "On Mouse Down" event. Could this event in Excel be used to change the cell B4 display? Paddler "Jim Thomlinson" wrote: 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Programming Cell ID's | Excel Discussion (Misc queries) | |||
Colour change in frozen colum when cell group is completed | Excel Discussion (Misc queries) | |||
move to adjacent cell with panes frozen | Excel Discussion (Misc queries) | |||
Returning reference of frozen cell | Excel Programming | |||
Frozen is cell | Excel Discussion (Misc queries) |