Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 150
Default How to make a selected row visible in the Window?

On Jan 24, 4:50*pm, Raj wrote:
Hi,

I have a worksheet and a Userform. The userform has a commandbutton to
which the following code is attached:
Cells(Selection.Row, 11).Offset(1, 0).Select
The idea is to select the the cell in Column 11 in the next row below.
This happens successfully. However, the row having the selected cell
is not automatically visible (vertically scrolled into )in the window.
How can I get this done?

Thanks in advance for the help.

Regards,
Raj


Hi,

I could solve the problem with the following code:
ActiveWindow.ScrollRow = Selection.Row

As it was an autofilter, I also preceded the following code to go to
the next visible row:
Do While ActiveCell.EntireRow.Hidden = True
ActiveCell.Offset(1, 0).Select
Loop
The complete code for the next button now is:
Cells(Selection.Row, 11).Offset(1, 0).Select
Do While ActiveCell.EntireRow.Hidden = True
ActiveCell.Offset(1, 0).Select
Loop
ActiveWindow.ScrollRow = Selection.Row

If there is a better way of doing this, I shall be glad to learn.

Thanks,
Raj



http://www.angelfire.com/biz7/julian...ans_macros.htm
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
How to make a selected row visible in the Window? Raj[_2_] Excel Programming 0 January 24th 08 11:50 AM
scroll window to display selected cell in visible area? Kate Excel Programming 5 January 3rd 06 03:38 PM
Make selected row visible to user when out of screen view ExcelMonkey Excel Programming 3 August 19th 05 12:43 PM
how do i make it so that when a sheat is selected either via link or tab, that xlLastCell is selected. the last on the sheet. Daniel Excel Worksheet Functions 1 July 12th 05 01:30 AM
make hidden window or workbook visible without specify the name mango Excel Worksheet Functions 1 December 30th 04 03:05 PM


All times are GMT +1. The time now is 08:05 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"