Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
ryany
 
Posts: n/a
Default Can I get current #row or #column in cell formula?

For example, I freeze pane for row 1, and want A1 cell to display "Text1"
when windows is scrolling within row 2~100, and display "Text2" when it's
scrolled beyond row 101, can I use such formula in A1:

=if(GetCurrentTopRow() < 100, "Text1", "Text2")

is there such a function?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default Can I get current #row or #column in cell formula?

use =ROW() to get the row number
--
Gary's Student


"ryany" wrote:

For example, I freeze pane for row 1, and want A1 cell to display "Text1"
when windows is scrolling within row 2~100, and display "Text2" when it's
scrolled beyond row 101, can I use such formula in A1:

=if(GetCurrentTopRow() < 100, "Text1", "Text2")

is there such a function?

  #3   Report Post  
Posted to microsoft.public.excel.misc
Ken Johnson
 
Posts: n/a
Default Can I get current #row or #column in cell formula?

Hi ryany,
I don't know of any way of achieving this without using an event
procedure.

The following Worksheet_SelectionChange Sub pasted into the code module
of the worksheet works.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveWindow.ScrollRow < 101 Then
Let Range("A1").Value = "Text1"
Else: Let Range("A1").Value = "Text2"
End If
End Sub

To get the code in place follow the following steps:

1.Copy the above code
2.Right Click the worksheet tab then select "View code" from the
contextual popup menu.
3.Paste the code into the blank code module.
4.Edit the "Text1" and "Text2" strings.
5.Return to Excel worksheet by pressing Alt + F11 or going FileClose
and Return to Microsoft Excel.

Ken Johnson

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
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM
Positioning Numeric Values Resulting from 6 Column Array Formula Sam via OfficeKB.com Excel Worksheet Functions 2 January 5th 06 02:03 AM
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
up to 7 functions? ALex Excel Worksheet Functions 10 April 12th 05 06:42 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 10:54 AM.

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"