Formula to make first visible row show 1 when scrolling?

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,080
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

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
12,299
Office Version
  1. 2013
  2. 2010
Platform
  1. Windows
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
 

Forum statistics

Threads
1,181,678
Messages
5,931,369
Members
436,788
Latest member
er19

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
Top