Formula to make first visible row show 1 when scrolling?

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,194
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Evenone,
I thought this would be easy but i dont know the words to do it? please help.

I have a sheet nameed data with about 10,000 lines of data

i've split the view at row 10 so i can scroll dowbn and still see whats going on above (I've used the freeze panes button)
as i scroll down i'd like a formula to do the folllowing
in column B show me the number 1 in the first visible row after row 10 (the last fixed row) so as i scroll down 11 = 1, but that gets hidden so it changes to 12, 13 etc.

can this be done?

please help if you can

Thanks

Tony
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Try this "work-around". Place this Worksheet_SelectionChange macro in the worksheet code module. Since there is no event macro that will capture scrolling, you will have to click on any cell in the sheet after you finish scrolling in order to insert the number "1" in column B of the first visible row after row 10.
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Scroll = ActiveWindow.ScrollRow
    Range("B:B").Replace "1", ""
    Range("B" & Scroll) = 1
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,659
Messages
6,120,786
Members
448,994
Latest member
rohitsomani

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top