Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Returning Cell to Upper-Left-Most Corner

Using VBA, I resort a range of cells by clicking on a column header.
After I have resorted based on a different column, the cells that are
visible are sometimes different. I was trying to find some code that
would record the upper-left-most cell into a variable, then return that
cell to the same upper-left-most corner, without changing the cell that
I have currently selected. Is this possible?

Thanks,

Carroll Rinehart

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Returning Cell to Upper-Left-Most Corner

One thing I want to add. I have the column headers frozen on row 6, so
that everything from row 7 on is scrollable. I don't know if this adds
to the complexity.

Carroll

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Returning Cell to Upper-Left-Most Corner

Dim toprow as Long
toprow = ActiveWindows.Pane(2).ScrollRow.row


then

ActiveWindow.Pane(2).ScrollRow = toprow

--
Regards,
Tom Ogilvy

"Carroll" wrote in message
ups.com...
One thing I want to add. I have the column headers frozen on row 6, so
that everything from row 7 on is scrollable. I don't know if this adds
to the complexity.

Carroll



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Returning Cell to Upper-Left-Most Corner

Thanks Tom. BTW, I am using Excel 2002.

After I have added the 3 lines of code, when it hits "toprow =
ActiveWindows.Pane(2).ScrollRow.Row", I get this error: "Run-time error
424. Object Required."

Carroll

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Returning Cell to Upper-Left-Most Corner

Sorry, that was a typo I though I had corrected before posting. it should
be

toprow = ActiveWindows.Pane(2).ScrollRow

--
Regards,
Tom Ogilvy

"Carroll" wrote in message
oups.com...
Thanks Tom. BTW, I am using Excel 2002.

After I have added the 3 lines of code, when it hits "toprow =
ActiveWindows.Pane(2).ScrollRow.Row", I get this error: "Run-time error
424. Object Required."

Carroll





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Returning Cell to Upper-Left-Most Corner

Tom,

I'm still getting the same error after removing ".row" from the end.
Also, I notice that this line shows "ActiveWindows" and the last line
of code provided shows "ActiveWindow" (without the s). I tried it both
ways and got an error either way.

Carroll

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
what is the little black triangle in the upper left corner of a cell FireBrick New Users to Excel 5 April 3rd 23 04:38 PM
Hyperlink to cell and have it appear at top upper left hand corner Bisonhawk New Users to Excel 5 December 4th 08 08:16 PM
What are the green triangles, in the upper left corner of a cell. Humber Excel Discussion (Misc queries) 3 October 4th 06 02:35 PM
grey dot in left upper corner of cell singnothing Excel Discussion (Misc queries) 1 April 1st 06 10:06 AM
Cell A1 in Upper Left Corner pjhageman[_6_] Excel Programming 3 January 10th 04 08:56 PM


All times are GMT +1. The time now is 05:42 PM.

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

About Us

"It's about Microsoft Excel"