Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming Cell ID's Jeremy Excel Discussion (Misc queries) 4 April 25th 07 06:42 AM
Colour change in frozen colum when cell group is completed cib Excel Discussion (Misc queries) 1 April 8th 07 10:44 PM
move to adjacent cell with panes frozen Aaron Excel Discussion (Misc queries) 1 October 5th 06 10:45 AM
Returning reference of frozen cell Pete at Sappi Fine Paper Excel Programming 4 August 18th 06 03:29 PM
Frozen is cell Stac at Chase Excel Discussion (Misc queries) 1 October 13th 05 07:48 PM


All times are GMT +1. The time now is 11:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"